[FFmpeg-cvslog] mux: Make sure that the data is actually written
Sean McGovern
git at videolan.org
Mon Sep 7 16:22:00 CEST 2015
ffmpeg | branch: master | Sean McGovern <gseanmcg at gmail.com> | Thu Aug 27 00:04:16 2015 -0400| [9ad1e0c12caa440de860bd8f2122beb11d73815c] | committer: Luca Barbato
mux: Make sure that the data is actually written
And forward the error if it is not.
Bug-Id: 881
CC: libav-stable at libav.org
Signed-off-by: Luca Barbato <lu_zero at gentoo.org>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ad1e0c12caa440de860bd8f2122beb11d73815c
---
libavformat/mux.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/libavformat/mux.c b/libavformat/mux.c
index 7959edf..4bba970 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -352,8 +352,12 @@ static int write_packet(AVFormatContext *s, AVPacket *pkt)
}
ret = s->oformat->write_packet(s, pkt);
- if (s->pb && ret >= 0 && s->flags & AVFMT_FLAG_FLUSH_PACKETS)
- avio_flush(s->pb);
+ if (s->pb && ret >= 0) {
+ if (s->flags & AVFMT_FLAG_FLUSH_PACKETS)
+ avio_flush(s->pb);
+ if (s->pb->error < 0)
+ ret = s->pb->error;
+ }
return ret;
}
More information about the ffmpeg-cvslog
mailing list