[FFmpeg-cvslog] movenc: Simplify setting the fragmentation flag

Martin Storsjö git at videolan.org
Tue Sep 10 10:46:48 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Mon Sep  9 14:35:09 2013 +0300| [bdf990425e2be6912a6d29f032ca558448c8635a] | committer: Martin Storsjö

movenc: Simplify setting the fragmentation flag

This makes sure the faststart vs fragmentation check works as
intended when fragmentation is enabled due to using the ismv mode.

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

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

 libavformat/movenc.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index c6c149d..46bc6e1 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3133,6 +3133,7 @@ static int mov_write_header(AVFormatContext *s)
     /* Set the FRAGMENT flag if any of the fragmentation methods are
      * enabled. */
     if (mov->max_fragment_duration || mov->max_fragment_size ||
+        (s->oformat && !strcmp(s->oformat->name, "ismv")) ||
         mov->flags & (FF_MOV_FLAG_EMPTY_MOOV |
                       FF_MOV_FLAG_FRAG_KEYFRAME |
                       FF_MOV_FLAG_FRAG_CUSTOM))
@@ -3151,9 +3152,7 @@ static int mov_write_header(AVFormatContext *s)
     /* Non-seekable output is ok if using fragmentation. If ism_lookahead
      * is enabled, we don't support non-seekable output at all. */
     if (!s->pb->seekable &&
-        ((!(mov->flags & FF_MOV_FLAG_FRAGMENT) &&
-          !(s->oformat && !strcmp(s->oformat->name, "ismv")))
-         || mov->ism_lookahead)) {
+        (!(mov->flags & FF_MOV_FLAG_FRAGMENT) || mov->ism_lookahead)) {
         av_log(s, AV_LOG_ERROR, "muxer does not support non seekable output\n");
         return -1;
     }
@@ -3288,8 +3287,7 @@ static int mov_write_header(AVFormatContext *s)
                             FF_MOV_FLAG_FRAG_CUSTOM)) &&
             !mov->max_fragment_duration && !mov->max_fragment_size)
             mov->max_fragment_duration = 5000000;
-        mov->flags |= FF_MOV_FLAG_EMPTY_MOOV | FF_MOV_FLAG_SEPARATE_MOOF |
-                      FF_MOV_FLAG_FRAGMENT;
+        mov->flags |= FF_MOV_FLAG_EMPTY_MOOV | FF_MOV_FLAG_SEPARATE_MOOF;
     }
 
     if (!(mov->flags & FF_MOV_FLAG_FRAGMENT)) {



More information about the ffmpeg-cvslog mailing list