* commit '448c8cfe4c53e9e806effd8505b46d57fa707061':
movenc: Support setting fragment_index before the moov atom is written
Conflicts:
libavformat/movenc.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
{"video_track_timescale","set timescale of all video tracks",offsetof(MOVMuxContext,video_track_timescale),AV_OPT_TYPE_INT,{.i64=0},0,INT_MAX,AV_OPT_FLAG_ENCODING_PARAM},
{"brand","Override major brand",offsetof(MOVMuxContext,major_brand),AV_OPT_TYPE_STRING,{.str=NULL},.flags=AV_OPT_FLAG_ENCODING_PARAM},
{"fragment_index","Fragment number of the next fragment",offsetof(MOVMuxContext,fragments),AV_OPT_TYPE_INT,{.i64=0},0,INT_MAX,AV_OPT_FLAG_ENCODING_PARAM},
{"fragment_index","Fragment number of the next fragment",offsetof(MOVMuxContext,fragments),AV_OPT_TYPE_INT,{.i64=1},1,INT_MAX,AV_OPT_FLAG_ENCODING_PARAM},
{"mov_gamma","gamma value for gama atom",offsetof(MOVMuxContext,gamma),AV_OPT_TYPE_FLOAT,{.dbl=0.0},0.0,10,AV_OPT_FLAG_ENCODING_PARAM},
{NULL},
};
@ -4058,7 +4058,7 @@ static int mov_flush_fragment(AVFormatContext *s)
if(!(mov->flags&FF_MOV_FLAG_FRAGMENT))
return0;
if(mov->fragments==0){
if(!mov->moov_written){
int64_tpos=avio_tell(s->pb);
uint8_t*buf;
intbuf_size,moov_size;
@ -4083,7 +4083,7 @@ static int mov_flush_fragment(AVFormatContext *s)
if(mov->flags&FF_MOV_FLAG_FASTSTART)
mov->reserved_moov_pos=avio_tell(s->pb);
avio_flush(s->pb);
mov->fragments++;
mov->moov_written=1;
return0;
}
@ -4094,7 +4094,7 @@ static int mov_flush_fragment(AVFormatContext *s)
avio_write(s->pb,buf,buf_size);
av_free(buf);
mov->fragments++;
mov->moov_written=1;
mov->mdat_size=0;
for(i=0;i<mov->nb_streams;i++){
if(mov->tracks[i].entry)
@ -4172,12 +4172,13 @@ static int mov_flush_fragment(AVFormatContext *s)