From c3312cb6cafad85adf764e75d465013a22d1840f Mon Sep 17 00:00:00 2001 From: Aidan Welch Date: Tue, 28 May 2019 00:46:00 -0400 Subject: [PATCH] added error logging to video_writer.c similar to video_reader.c Change-Id: Ib56b3e309113574a69ae09db1ee5b0fcc14ebe88 --- video_writer.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/video_writer.c b/video_writer.c index 56d428b07..6e9a848bc 100644 --- a/video_writer.c +++ b/video_writer.c @@ -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; } -- 2.40.0