[FFmpeg-cvslog] r11226 - trunk/libavformat/mov.c

bcoudurier subversion
Sat Dec 15 20:08:42 CET 2007


Author: bcoudurier
Date: Sat Dec 15 20:08:42 2007
New Revision: 11226

Log:
choose next sample by sample position
when streams' next dts difference is below AV_TIME_BASE,
to reduce seeking, needed for slow underlying protocols (http),
a slightly modified patch from elupus, elupus at ecce dot se


Modified:
   trunk/libavformat/mov.c

Modified: trunk/libavformat/mov.c
==============================================================================
--- trunk/libavformat/mov.c	(original)
+++ trunk/libavformat/mov.c	Sat Dec 15 20:08:42 2007
@@ -1511,7 +1511,9 @@ static int mov_read_packet(AVFormatConte
             int64_t dts = av_rescale(current_sample->timestamp * (int64_t)msc->time_rate, AV_TIME_BASE, msc->time_scale);
 
             dprintf(s, "stream %d, sample %d, dts %"PRId64"\n", i, msc->current_sample, dts);
-            if (dts < best_dts) {
+            if (!sample ||
+                ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||
+                 (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts))) {
                 sample = current_sample;
                 best_dts = dts;
                 sc = msc;




More information about the ffmpeg-cvslog mailing list