diff --git a/libavformat/movenc.c b/libavformat/movenc.c index 25d4c5fbce..41a47597f4 100644 --- a/libavformat/movenc.c +++ b/libavformat/movenc.c @@ -4181,6 +4181,9 @@ static int mov_flush_fragment(AVFormatContext *s) avio_write(s->pb, buf, buf_size); av_free(buf); + if (mov->flags & FF_MOV_FLAG_FASTSTART) + mov->reserved_header_pos = avio_tell(s->pb); + mov->moov_written = 1; mov->mdat_size = 0; for (i = 0; i < mov->nb_streams; i++) {