[FFmpeg-cvslog] movenc: Set all implicit flags immediately in mov_write_header

Martin Storsjö git at videolan.org
Mon Sep 23 12:33:51 CEST 2013


ffmpeg | branch: master | Martin Storsjö <martin at martin.st> | Tue Sep 10 15:56:19 2013 +0300| [a9553bbb336a7186c62b3b14a0499c1b6ba61ebd] | committer: Martin Storsjö

movenc: Set all implicit flags immediately in mov_write_header

This makes sure other sanity checks for conflicting options
can work properly, e.g. for the conflict between the faststart
flag when using the ismv mode.

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

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

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

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index dd0a31f..16107b1 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -3154,12 +3154,16 @@ 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 ||
-        mov->mode == MODE_ISM ||
         mov->flags & (FF_MOV_FLAG_EMPTY_MOOV |
                       FF_MOV_FLAG_FRAG_KEYFRAME |
                       FF_MOV_FLAG_FRAG_CUSTOM))
         mov->flags |= FF_MOV_FLAG_FRAGMENT;
 
+    /* Set other implicit flags immediately */
+    if (mov->mode == MODE_ISM)
+        mov->flags |= FF_MOV_FLAG_EMPTY_MOOV | FF_MOV_FLAG_SEPARATE_MOOF |
+                      FF_MOV_FLAG_FRAGMENT;
+
     /* faststart: moov at the beginning of the file, if supported */
     if (mov->flags & FF_MOV_FLAG_FASTSTART) {
         if ((mov->flags & FF_MOV_FLAG_FRAGMENT) ||
@@ -3297,7 +3301,6 @@ 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;
     }
 
     if (!(mov->flags & FF_MOV_FLAG_FRAGMENT)) {



More information about the ffmpeg-cvslog mailing list