]> git.sesse.net Git - ffmpeg/commitdiff
Merge commit '26ac22e5e7394346e9d59f800e7d4e91f4518d33'
authorHendrik Leppkes <h.leppkes@gmail.com>
Tue, 18 Aug 2015 06:50:22 +0000 (08:50 +0200)
committerHendrik Leppkes <h.leppkes@gmail.com>
Tue, 18 Aug 2015 06:50:22 +0000 (08:50 +0200)
* commit '26ac22e5e7394346e9d59f800e7d4e91f4518d33':
  movenc: Add a new flag for writing global sidx indexes for dash

Conflicts:
libavformat/movenc.c
libavformat/movenc.h

Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
1  2 
libavformat/movenc.c
libavformat/movenc.h

index 41a47597f4cf9b1b8cd7853d8f4ba576f1733bbf,ee2f0892f02d33efea6a47cc5cf2beca23fa3857..08d0c2a77203a3df30f84061c57037917b66e4f2
@@@ -66,10 -62,9 +66,11 @@@ static const AVOption options[] = 
      { "dash", "Write DASH compatible fragmented MP4", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_DASH}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
      { "frag_discont", "Signal that the next fragment is discontinuous from earlier ones", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_FRAG_DISCONT}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
      { "delay_moov", "Delay writing the initial moov until the first fragment is cut, or until the first fragment flush", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_DELAY_MOOV}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
+     { "global_sidx", "Write a global sidx index at the start of the file", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_GLOBAL_SIDX}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
 +    { "write_colr", "Write colr atom (Experimental, may be renamed or changed, do not use from scripts)", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_WRITE_COLR}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
 +    { "write_gama", "Write deprecated gama atom", 0, AV_OPT_TYPE_CONST, {.i64 = FF_MOV_FLAG_WRITE_GAMA}, INT_MIN, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM, "movflags" },
      FF_RTP_FLAG_OPTS(MOVMuxContext, rtp_flags),
 -    { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.i64 = 0}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
 +    { "skip_iods", "Skip writing iods atom.", offsetof(MOVMuxContext, iods_skip), AV_OPT_TYPE_INT, {.i64 = 1}, 0, 1, AV_OPT_FLAG_ENCODING_PARAM},
      { "iods_audio_profile", "iods audio profile atom.", offsetof(MOVMuxContext, iods_audio_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM},
      { "iods_video_profile", "iods video profile atom.", offsetof(MOVMuxContext, iods_video_profile), AV_OPT_TYPE_INT, {.i64 = -1}, -1, 255, AV_OPT_FLAG_ENCODING_PARAM},
      { "frag_duration", "Maximum fragment duration", offsetof(MOVMuxContext, max_fragment_duration), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT_MAX, AV_OPT_FLAG_ENCODING_PARAM},
@@@ -4163,11 -3226,10 +4164,11 @@@ static int mov_flush_fragment(AVFormatC
  
          if (mov->flags & FF_MOV_FLAG_DELAY_MOOV)
              mov_write_identification(s->pb, s);
 -        mov_write_moov_tag(s->pb, mov, s);
 +        if ((ret = mov_write_moov_tag(s->pb, mov, s)) < 0)
 +            return ret;
  
          if (mov->flags & FF_MOV_FLAG_DELAY_MOOV) {
-             if (mov->flags & FF_MOV_FLAG_FASTSTART)
+             if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
                  mov->reserved_header_pos = avio_tell(s->pb);
              avio_flush(s->pb);
              mov->moov_written = 1;
@@@ -5301,10 -4047,9 +5302,10 @@@ static int mov_write_header(AVFormatCon
  
      if (mov->flags & FF_MOV_FLAG_EMPTY_MOOV &&
          !(mov->flags & FF_MOV_FLAG_DELAY_MOOV)) {
 -        mov_write_moov_tag(pb, mov, s);
 +        if ((ret = mov_write_moov_tag(pb, mov, s)) < 0)
 +            return ret;
          mov->moov_written = 1;
-         if (mov->flags & FF_MOV_FLAG_FASTSTART)
+         if (mov->flags & FF_MOV_FLAG_GLOBAL_SIDX)
              mov->reserved_header_pos = avio_tell(pb);
      }
  
index 72862f1b10f7aebb40a1322675fd0e4dc6cc71c9,22b883296aa1d0255e49c9cc803a9305d6372db0..06adf2b1217d5d6dff3d08bf887e0f6abc9cb262
@@@ -209,8 -192,7 +209,9 @@@ typedef struct MOVMuxContext 
  #define FF_MOV_FLAG_DASH                  (1 << 11)
  #define FF_MOV_FLAG_FRAG_DISCONT          (1 << 12)
  #define FF_MOV_FLAG_DELAY_MOOV            (1 << 13)
- #define FF_MOV_FLAG_WRITE_COLR            (1 << 14)
- #define FF_MOV_FLAG_WRITE_GAMA            (1 << 15)
+ #define FF_MOV_FLAG_GLOBAL_SIDX           (1 << 14)
++#define FF_MOV_FLAG_WRITE_COLR            (1 << 15)
++#define FF_MOV_FLAG_WRITE_GAMA            (1 << 16)
  
  int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt);