diff --git a/libavformat/movenc.c b/libavformat/movenc.c index f11633525e..246fc2912c 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -6509,9 +6509,9 @@ static int mov_flush_fragment(AVFormatContext *s, int force) int buf_size, write_moof = 1, moof_tracks = -1; uint8_t *buf; + if (!track->entry) + continue; if (mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) { - if (!track->entry) - continue; mdat_size = avio_tell(track->mdat_buf); moof_tracks = i; } else { diff --git a/tests/fate/mov.mak b/tests/fate/mov.mak index f7e5e52217..6ab61e9f00 100644 --- a/tests/fate/mov.mak +++ b/tests/fate/mov.mak @@ -84,6 +84,11 @@ fate-mov-ibi-elst-starts-b: CMD = framemd5 -flags +bitexact -i $(TARGET_SAMPLES) # Makes sure that we handle overlapping framgments fate-mov-frag-overlap: CMD = framemd5 -i $(TARGET_SAMPLES)/mov/frag_overlap.mp4 +fate-mov-mp4-frag-flush: CMD = md5 -f lavfi -i color=blue,format=rgb24,trim=duration=0.04 -f lavfi -i anullsrc,aformat=s16,atrim=duration=2 -c:v png -c:a pcm_s16le -movflags +empty_moov+hybrid_fragmented -frag_duration 1000000 -frag_interleave 1 -f mp4 +fate-mov-mp4-frag-flush: CMP = oneline +fate-mov-mp4-frag-flush: REF = a10c0e2e2dfc120f31ca5e59e0e4392a +FATE_MOV-$(call ALLYES, LAVFI_INDEV, COLOR_FILTER, FORMAT_FILTER, TRIM_FILTER, ANULL_FILTER, AFORMAT_FILTER, ATRIM_FILTER, PNG_ENCODER, PCM_S16LE_ENCODER, MOV_MUXER) += fate-mov-mp4-frag-flush + # Makes sure that we pick the right frames according to edit list when there is no keyframe with PTS < edit list start. # For example, when video starts on a B-frame, and edit list starts on that B-frame too. # GOP structure : B B I in presentation order.