changeset 34751:97b5fb86090e

Fix write_buffer: flush after each write and return an error code when an error occurred.
author reimar
date Wed, 04 Apr 2012 18:45:37 +0000
parents 76ab607371dc
children ad2b851c3f19
files stream/stream_ffmpeg.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream_ffmpeg.c	Wed Apr 04 18:42:33 2012 +0000
+++ b/stream/stream_ffmpeg.c	Wed Apr 04 18:45:37 2012 +0000
@@ -34,7 +34,11 @@
 
 static int write_buffer(stream_t *s, char *buffer, int len)
 {
+    AVIOContext *ctx = s->priv;
     avio_write(s->priv, buffer, len);
+    avio_flush(s->priv);
+    if (ctx->error)
+        return -1;
     return len;
 }