aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorVladimir Pantelic <vladoman@gmail.com>2011-03-17 14:56:14 +0100
committerMans Rullgard <mans@mansr.com>2011-03-17 16:25:54 +0000
commitde11ee906ed232157392924735c18ab7d8522ccb (patch)
tree2be277c8ce6a81851286a043609782f86df9d314 /libavformat
parentf1f60f5252b0b448adcce0c1c52f3161ee69b9bf (diff)
downloadffmpeg-de11ee906ed232157392924735c18ab7d8522ccb.tar.gz
asfdec: subtract the preroll value and thus output 0 based timestamps
Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/asfdec.c3
-rw-r--r--libavformat/avformat.h2
2 files changed, 2 insertions, 3 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index e27c29b193..79b3bcbe88 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -236,6 +236,7 @@ static int asf_read_stream_properties(AVFormatContext *s, int64_t size)
if (!asf_st)
return AVERROR(ENOMEM);
st->priv_data = asf_st;
+ st->start_time = 0;
start_time = asf->hdr.preroll;
asf_st->stream_language_index = 128; // invalid stream index means no language info
@@ -960,7 +961,7 @@ static int ff_asf_parse_packet(AVFormatContext *s, AVIOContext *pb, AVPacket *pk
/* new packet */
av_new_packet(&asf_st->pkt, asf->packet_obj_size);
asf_st->seq = asf->packet_seq;
- asf_st->pkt.dts = asf->packet_frag_timestamp;
+ asf_st->pkt.dts = asf->packet_frag_timestamp - asf->hdr.preroll;
asf_st->pkt.stream_index = asf->stream_index;
asf_st->pkt.pos =
asf_st->packet_pos= asf->packet_pos;
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index ce50053f49..ca179d2ad3 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -534,8 +534,6 @@ typedef struct AVStream {
* Only set this if you are absolutely 100% sure that the value you set
* it to really is the pts of the first frame.
* This may be undefined (AV_NOPTS_VALUE).
- * @note The ASF header does NOT contain a correct start_time the ASF
- * demuxer must NOT set this.
*/
int64_t start_time;