ref: c3312cb6cafad85adf764e75d465013a22d1840f
parent: 73ab008d26a0b61920267b6d24b31101bbfde2f3
author: Aidan Welch <[email protected]>
date: Mon May 27 20:46:00 EDT 2019
added error logging to video_writer.c similar to video_reader.c Change-Id: Ib56b3e309113574a69ae09db1ee5b0fcc14ebe88
--- 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;
}