summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-03 17:44:56 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-03 18:10:04 +0200
commitfee982048e338efd3b8c1b2dcaf826cb7944cd81 (patch)
tree94a6abe71f8a853d15fa9a6e87819936060c8a7b /libavformat/mux.c
parentb4d525eb634666e39745585b17c35faed54352b6 (diff)
avformat/mux: flush after header writing, like after packets
This makes problematic unconditional flushes in mpegts redundant And is thus part of a fix for ticket 2748 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r--libavformat/mux.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c
index be72d91867..dbb9b55f39 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -421,6 +421,8 @@ int avformat_write_header(AVFormatContext *s, AVDictionary **options)
ret = s->pb->error;
if (ret < 0)
return ret;
+ if (s->flush_packets && s->pb && s->pb->error >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
+ avio_flush(s->pb);
}
if ((ret = init_pts(s)) < 0)