Module: libav
Branch: release/11
Commit: 7e44037198fc19f418a5de6b029fae782f71ec06

Author:    Sean McGovern <[email protected]>
Committer: Luca Barbato <[email protected]>
Date:      Thu Aug 27 00:04:16 2015 -0400

mux: Make sure that the data is actually written

And forward the error if it is not.

Bug-Id: 881

CC: [email protected]

Signed-off-by: Luca Barbato <[email protected]>

---

 libavformat/mux.c |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/mux.c b/libavformat/mux.c
index d4492d1..6cfbd18 100644
--- a/libavformat/mux.c
+++ b/libavformat/mux.c
@@ -333,8 +333,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;
 }

_______________________________________________
libav-commits mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to