shithub: libvpx

Download patch

ref: 8c8957048832ba3d0d60f7d8122db1ba0aa8042d
parent: f7a07b60adeed880561a9d7c20259bf4ec28568c
parent: c3312cb6cafad85adf764e75d465013a22d1840f
author: Aidan Welch <aidansw@yahoo.com>
date: Wed May 29 21:50:10 EDT 2019

Merge "added error logging to video_writer.c similar to video_reader.c"

--- a/video_writer.c
+++ b/video_writer.c
@@ -37,11 +37,15 @@
   if (container == kContainerIVF) {
     VpxVideoWriter *writer = NULL;
     FILE *const file = fopen(filename, "wb");
-    if (!file) return NULL;
-
+    if (!file) {
+      fprintf(stderr, "%s can't be written to.\n", filename);
+      return NULL;
+    }
     writer = malloc(sizeof(*writer));
-    if (!writer) return NULL;
-
+    if (!writer) {
+      fprintf(stderr, "Can't allocate VpxVideoWriter.\n");
+      return NULL;
+    }
     writer->frame_count = 0;
     writer->info = *info;
     writer->file = file;
@@ -50,7 +54,7 @@
 
     return writer;
   }
-
+  fprintf(stderr, "VpxVideoWriter supports only IVF.\n");
   return NULL;
 }