[FFmpeg-devel] [PATCH] movdec: interleave streams better.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Fri Nov 30 23:06:59 CET 2012


1 second can be a lot of data to buffer.
Possibly it would be better to make this configurable
instead of hard-coding it to 1/4th second.
Any kind of suggestions or comments welcome.

Signed-off-by: Reimar Döffinger <Reimar.Doeffinger at gmx.de>
---
 libavformat/mov.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 4d6957f..da5ce5f 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -3228,8 +3228,8 @@ static AVIndexEntry *mov_find_next_sample(AVFormatContext *s, AVStream **st)
             if (!sample || (!s->pb->seekable && current_sample->pos < sample->pos) ||
                 (s->pb->seekable &&
                  ((msc->pb != s->pb && dts < best_dts) || (msc->pb == s->pb &&
-                 ((FFABS(best_dts - dts) <= AV_TIME_BASE && current_sample->pos < sample->pos) ||
-                  (FFABS(best_dts - dts) > AV_TIME_BASE && dts < best_dts)))))) {
+                 ((FFABS(best_dts - dts) <= AV_TIME_BASE / 4 && current_sample->pos < sample->pos) ||
+                  (FFABS(best_dts - dts) > AV_TIME_BASE / 4 && dts < best_dts)))))) {
                 sample = current_sample;
                 best_dts = dts;
                 *st = avst;
-- 
1.7.10.4



More information about the ffmpeg-devel mailing list