]> granicus.if.org Git - libvpx/commitdiff
added error logging to video_writer.c similar to video_reader.c
authorAidan Welch <aidansw@yahoo.com>
Tue, 28 May 2019 04:46:00 +0000 (00:46 -0400)
committerAidan Welch <aidansw@yahoo.com>
Wed, 29 May 2019 21:34:48 +0000 (21:34 +0000)
Change-Id: Ib56b3e309113574a69ae09db1ee5b0fcc14ebe88

video_writer.c

index 56d428b0720f7101451ff3b130fa9d47550d9dea..6e9a848bc3dbcd3f9b53a3f823ba5fcf607abc4d 100644 (file)
@@ -37,11 +37,15 @@ VpxVideoWriter *vpx_video_writer_open(const char *filename,
   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 @@ VpxVideoWriter *vpx_video_writer_open(const char *filename,
 
     return writer;
   }
-
+  fprintf(stderr, "VpxVideoWriter supports only IVF.\n");
   return NULL;
 }