summaryrefslogtreecommitdiff
path: root/libavformat/asfdec.c
diff options
context:
space:
mode:
authorVladimir Pantelic <vladoman@gmail.com>2011-03-17 22:34:52 +0100
committerMans Rullgard <mans@mansr.com>2011-03-23 13:46:19 +0000
commit4377fafda100117f75d62ba91bce6d8509e01a50 (patch)
tree65a8af34e07b4f4bbfca3299fe2b8d70970f9b67 /libavformat/asfdec.c
parent264935c96212c922e63c1fdb3c6ebf0bfce5c45d (diff)
asfdec: also subtract preroll when reading simple index object
This was missed when ASF was changed to return timestamps without preroll. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavformat/asfdec.c')
-rw-r--r--libavformat/asfdec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/asfdec.c b/libavformat/asfdec.c
index 15dc55b823..14ef2a5c37 100644
--- a/libavformat/asfdec.c
+++ b/libavformat/asfdec.c
@@ -1219,10 +1219,10 @@ static void asf_build_simple_index(AVFormatContext *s, int stream_index)
int pktnum=avio_rl32(s->pb);
int pktct =avio_rl16(s->pb);
int64_t pos = s->data_offset + s->packet_size*(int64_t)pktnum;
- int64_t index_pts= av_rescale(itime, i, 10000);
+ int64_t index_pts= FFMAX(av_rescale(itime, i, 10000) - asf->hdr.preroll, 0);
if(pos != last_pos){
- av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d\n", pktnum, pktct);
+ av_log(s, AV_LOG_DEBUG, "pktnum:%d, pktct:%d pts: %"PRId64"\n", pktnum, pktct, index_pts);
av_add_index_entry(s->streams[stream_index], pos, index_pts, s->packet_size, 0, AVINDEX_KEYFRAME);
last_pos=pos;
}