movenc: Avoid writing separate flags for the first sample if not necessary

Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Martin Storsjö 2015-03-06 11:26:40 +02:00
parent 00d751d4fc
commit 46d4d85759
1 changed files with 2 additions and 1 deletions

View File

@ -2490,7 +2490,8 @@ static int mov_write_trun_tag(AVIOContext *pb, MOVMuxContext *mov,
if (i > 0 && get_sample_flags(track, &track->cluster[i]) != track->default_sample_flags) if (i > 0 && get_sample_flags(track, &track->cluster[i]) != track->default_sample_flags)
flags |= MOV_TRUN_SAMPLE_FLAGS; flags |= MOV_TRUN_SAMPLE_FLAGS;
} }
if (!(flags & MOV_TRUN_SAMPLE_FLAGS)) if (!(flags & MOV_TRUN_SAMPLE_FLAGS) && track->entry > 0 &&
get_sample_flags(track, &track->cluster[0]) != track->default_sample_flags)
flags |= MOV_TRUN_FIRST_SAMPLE_FLAGS; flags |= MOV_TRUN_FIRST_SAMPLE_FLAGS;
if (track->flags & MOV_TRACK_CTTS) if (track->flags & MOV_TRACK_CTTS)
flags |= MOV_TRUN_SAMPLE_CTS; flags |= MOV_TRUN_SAMPLE_CTS;