From c599c211fb719f07f390148352a5caef347d5af9 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sat, 28 Jun 2014 21:23:32 +0200 Subject: [PATCH] avformat/mux: fix flush_packets flag with flushing buffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Found-by: Reimar Döffinger Signed-off-by: Michael Niedermayer --- libavformat/mux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/mux.c b/libavformat/mux.c index afdeca1afb..687f7043da 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -632,7 +632,7 @@ int av_write_frame(AVFormatContext *s, AVPacket *pkt) if (!pkt) { if (s->oformat->flags & AVFMT_ALLOW_FLUSH) { ret = s->oformat->write_packet(s, NULL); - if (s->flush_packets && s->pb && s->pb->error >= 0) + if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS) avio_flush(s->pb); if (ret >= 0 && s->pb && s->pb->error < 0) ret = s->pb->error;