summaryrefslogtreecommitdiff
path: root/libavformat/mux.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-03-12 16:54:42 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-03-24 23:19:07 +0100
commit4f112a8e34022c821be885ed293abc0b120c875b (patch)
treec8f636ef2e96887d9c043e3b362e1b7cff10b2bb /libavformat/mux.c
parent125acd215250ead008938266efcacd56743f3a2a (diff)
lavf/mux: add the flush_packets option.
Note: a lot of muxers already do the flushing explicitly.
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 3578a52034..29ab3f5dc2 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -494,6 +494,8 @@ static inline int split_write_packet(AVFormatContext *s, AVPacket *pkt)
did_split = av_packet_split_side_data(pkt);
ret = s->oformat->write_packet(s, pkt);
+ if (s->flush_packets && s->pb && s->pb->error >= 0)
+ avio_flush(s->pb);
if (did_split)
av_packet_merge_side_data(pkt);
return ret;