diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-08-03 17:44:56 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-08-03 18:10:04 +0200 |
commit | fee982048e338efd3b8c1b2dcaf826cb7944cd81 (patch) | |
tree | 94a6abe71f8a853d15fa9a6e87819936060c8a7b | |
parent | b4d525eb634666e39745585b17c35faed54352b6 (diff) | |
download | ffmpeg-fee982048e338efd3b8c1b2dcaf826cb7944cd81.tar.gz |
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>
-rw-r--r-- | libavformat/mux.c | 2 |
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) |