diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c index 8eb8547f36..2ea462d23d 100644 --- a/libavformat/mxfenc.c +++ b/libavformat/mxfenc.c @@ -857,11 +857,10 @@ static int mxf_write_footer(AVFormatContext *s) ByteIOContext *pb = s->pb; int64_t byte_position= url_ftell(pb); - if (!url_is_streamed(s->pb)) { - mxf_write_partition(s, byte_position, 0, footer_partition_key); - put_flush_packet(pb); + mxf_write_partition(s, byte_position, 0, footer_partition_key); + put_flush_packet(pb); + if (!url_is_streamed(s->pb)) mxf_update_header_partition(s, byte_position); - } mxf_free(s); return 0; }