Module: libav
Branch: master
Commit: f19fbfbdc637e08ad5c980807ede2d023f20c049

Author:    Martin Storsjö <mar...@martin.st>
Committer: Martin Storsjö <mar...@martin.st>
Date:      Sun Sep  3 00:02:54 2017 +0300

aviocat: Check for output write errors

Signed-off-by: Martin Storsjö <mar...@martin.st>

---

 tools/aviocat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tools/aviocat.c b/tools/aviocat.c
index 3e49a61..73104da 100644
--- a/tools/aviocat.c
+++ b/tools/aviocat.c
@@ -107,6 +107,11 @@ int main(int argc, char **argv)
         if (n <= 0)
             break;
         avio_write(output, buf, n);
+        if (output->error) {
+            av_strerror(output->error, errbuf, sizeof(errbuf));
+            fprintf(stderr, "Unable to write %s: %s\n", output_url, errbuf);
+            break;
+        }
         stream_pos += n;
         if (bps) {
             avio_flush(output);

_______________________________________________
libav-commits mailing list
libav-commits@libav.org
https://lists.libav.org/mailman/listinfo/libav-commits

Reply via email to