diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-07 16:19:40 +0200 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2015-09-07 16:19:40 +0200 |
commit | 1f1c10083352d2d118818b31ec223de8b24fae53 (patch) | |
tree | b08a4affecc17e8ee1326b83b2cfd1e72ae35bdd /libavformat/mux.c | |
parent | 88e7ea3e560373d443c49fa8857b999410225fe2 (diff) | |
parent | 9ad1e0c12caa440de860bd8f2122beb11d73815c (diff) | |
download | ffmpeg-1f1c10083352d2d118818b31ec223de8b24fae53.tar.gz |
Merge commit '9ad1e0c12caa440de860bd8f2122beb11d73815c'
* commit '9ad1e0c12caa440de860bd8f2122beb11d73815c':
mux: Make sure that the data is actually written
Merged-by: Hendrik Leppkes <h.leppkes@gmail.com>
Diffstat (limited to 'libavformat/mux.c')
-rw-r--r-- | libavformat/mux.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavformat/mux.c b/libavformat/mux.c index f2c137fa9e..37b5976464 100644 --- a/libavformat/mux.c +++ b/libavformat/mux.c @@ -660,8 +660,13 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt) ret = s->oformat->write_packet(s, pkt); } - if (s->flush_packets && s->pb && ret >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS) - avio_flush(s->pb); + if (s->pb && ret >= 0) { + if (s->flush_packets && s->flags & AVFMT_FLAG_FLUSH_PACKETS) + avio_flush(s->pb); + if (s->pb->error < 0) + ret = s->pb->error; + } + if (did_split) av_packet_merge_side_data(pkt); |