changeset 3016:eac2648449a5 libavformat

back_ptr calculation used wrong timebase when searching for back syncpoint
author ods15
date Mon, 04 Feb 2008 10:48:41 +0000
parents db8d14740060
children a086b58a3336
files nutenc.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/nutenc.c	Mon Feb 04 10:45:32 2008 +0000
+++ b/nutenc.c	Mon Feb 04 10:48:41 2008 +0000
@@ -476,7 +476,11 @@
         ff_nut_reset_ts(nut, *nus->time_base, pkt->dts);
         for(i=0; i<s->nb_streams; i++){
             AVStream *st= s->streams[i];
-            int index= av_index_search_timestamp(st, pkt->dts, AVSEEK_FLAG_BACKWARD);
+            int64_t dts_tb = av_rescale_rnd(pkt->dts,
+                nus->time_base->num * (int64_t)nut->stream[i].time_base->den,
+                nus->time_base->den * (int64_t)nut->stream[i].time_base->num,
+                AV_ROUND_DOWN);
+            int index= av_index_search_timestamp(st, dts_tb, AVSEEK_FLAG_BACKWARD);
             if(index>=0) dummy.pos= FFMIN(dummy.pos, st->index_entries[index].pos);
         }
         if(dummy.pos == INT64_MAX)