[FFmpeg-cvslog] movenc: Place the sidx index after the initial moov/mdat pair

Martin Storsjö git at videolan.org
Mon Aug 10 11:26:56 CEST 2015


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Sun Aug  9 22:40:39 2015 +0300| [5f200bbf98efe50f63d0515b115d2ba8dae297bc] | committer: Martin Storsjö

movenc: Place the sidx index after the initial moov/mdat pair

For fragmented files with non-empty moov, with a fragment index
(sidx), place the index after the initial moov/mdat pair.

Previously, for this pathological case, the index was written
at the start of the file.

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5f200bbf98efe50f63d0515b115d2ba8dae297bc
---

 libavformat/movenc.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index feb6a84..bb2504f 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3242,6 +3242,9 @@ static int mov_flush_fragment(AVFormatContext *s)
         avio_write(s->pb, buf, buf_size);
         av_free(buf);
 
+        if (mov->flags & FF_MOV_FLAG_FASTSTART)
+            mov->reserved_header_pos = avio_tell(s->pb);
+
         mov->moov_written = 1;
         mov->mdat_size = 0;
         for (i = 0; i < mov->nb_streams; i++) {



More information about the ffmpeg-cvslog mailing list