aviocat: Check for output write errors
authorMartin Storsjö <martin@martin.st>
Sat, 2 Sep 2017 21:02:54 +0000 (00:02 +0300)
committerMartin Storsjö <martin@martin.st>
Mon, 4 Sep 2017 06:42:52 +0000 (09:42 +0300)
Signed-off-by: Martin Storsjö <martin@martin.st>
tools/aviocat.c

index 3e49a61..73104da 100644 (file)
@@ -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);