OSDN Git Service

movenc: Add a fallback fragmentation method for plain mp4 as well
authorMartin Storsjö <martin@martin.st>
Tue, 18 Feb 2014 14:11:59 +0000 (16:11 +0200)
committerMartin Storsjö <martin@martin.st>
Wed, 19 Feb 2014 07:58:14 +0000 (09:58 +0200)
Previously the default fragmentation method was only enabled
if writing an ISM file.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/movenc.c

index 43a1647..762cfef 100644 (file)
@@ -3315,15 +3315,13 @@ static int mov_write_header(AVFormatContext *s)
 
     enable_tracks(s);
 
-    if (mov->mode == MODE_ISM) {
+    if (mov->flags & FF_MOV_FLAG_FRAGMENT) {
         /* If no fragmentation options have been set, set a default. */
         if (!(mov->flags & (FF_MOV_FLAG_FRAG_KEYFRAME |
                             FF_MOV_FLAG_FRAG_CUSTOM)) &&
             !mov->max_fragment_duration && !mov->max_fragment_size)
             mov->flags |= FF_MOV_FLAG_FRAG_KEYFRAME;
-    }
-
-    if (!(mov->flags & FF_MOV_FLAG_FRAGMENT)) {
+    } else {
         if (mov->flags & FF_MOV_FLAG_FASTSTART)
             mov->reserved_moov_pos = avio_tell(pb);
         mov_write_mdat_tag(pb, mov);