Skip to content

Commit

Permalink
added error logging to video_writer.c similar to video_reader.c
Browse files Browse the repository at this point in the history
Change-Id: Ib56b3e309113574a69ae09db1ee5b0fcc14ebe88
  • Loading branch information
AidanWelch committed May 29, 2019
1 parent 73ab008 commit c3312cb
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions video_writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -50,7 +54,7 @@ VpxVideoWriter *vpx_video_writer_open(const char *filename,

return writer;
}

fprintf(stderr, "VpxVideoWriter supports only IVF.\n");
return NULL;
}

Expand Down

0 comments on commit c3312cb

Please sign in to comment.