- { "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 },
};
@@ -1895,7+1895,7 @@ static int mov_write_ctts_tag(AVIOContext *pb, MOVTrack *track)
/* Time to sample atom */
static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
{
- MOVStts *stts_entries;
+ MOVStts *stts_entries = NULL;
uint32_t entries = -1;
uint32_t atom_size;
int i;
@@ -1908,11+1908,11 @@ static int mov_write_stts_tag(AVIOContext *pb, MOVTrack *track)
stts_entries[0].duration = 1;
entries = 1;
} else {
- stts_entries = track->entry ?
- av_malloc_array(track->entry, sizeof(*stts_entries)) : /* worst case */
- NULL;
- if (track->entry && !stts_entries)
- return AVERROR(ENOMEM);
+ if (track->entry) {
+ stts_entries = av_malloc_array(track->entry, sizeof(*stts_entries)); /* worst case */
+ if (!stts_entries)
+ return AVERROR(ENOMEM);
+ }
for (i = 0; i < track->entry; i++) {
int duration = get_cluster_duration(track, i);
if (i && duration == stts_entries[entries].duration) {
@@ -3335,6+3335,12 @@ static int mov_write_mfhd_tag(AVIOContext *pb, MOVMuxContext *mov)