movenc: Ensure no separate moof written for empty track
track->mdat_buf can be not NULL while the track is still empty if the last packet write failed. Signed-off-by: Hu Weiwen <sehuww@mail.scut.edu.cn> Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
dbe40478e2
commit
2b77a2f723
@ -5422,7 +5422,7 @@ static int mov_flush_fragment(AVFormatContext *s, int force)
|
|||||||
duration = track->start_dts + track->track_duration -
|
duration = track->start_dts + track->track_duration -
|
||||||
track->cluster[0].dts;
|
track->cluster[0].dts;
|
||||||
if (mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) {
|
if (mov->flags & FF_MOV_FLAG_SEPARATE_MOOF) {
|
||||||
if (!track->mdat_buf)
|
if (!track->entry)
|
||||||
continue;
|
continue;
|
||||||
mdat_size = avio_tell(track->mdat_buf);
|
mdat_size = avio_tell(track->mdat_buf);
|
||||||
moof_tracks = i;
|
moof_tracks = i;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user