vpx_codec_ctx_t decoder;
char *fn = NULL;
int i;
+ int ret = EXIT_FAILURE;
uint8_t *buf = NULL;
size_t bytes_in_buffer = 0, buffer_size = 0;
FILE *infile;
dec_flags)) {
fprintf(stderr, "Failed to initialize decoder: %s\n",
vpx_codec_error(&decoder));
- return EXIT_FAILURE;
+ goto fail2;
}
if (!quiet) fprintf(stderr, "%s\n", decoder.name);
vpx_codec_control(&decoder, VP8_SET_POSTPROC, &vp8_pp_cfg)) {
fprintf(stderr, "Failed to configure postproc: %s\n",
vpx_codec_error(&decoder));
- return EXIT_FAILURE;
+ goto fail;
}
#endif
&ext_fb_list)) {
fprintf(stderr, "Failed to configure external frame buffers: %s\n",
vpx_codec_error(&decoder));
- return EXIT_FAILURE;
+ goto fail;
}
}
"Scaling is disabled in this configuration. "
"To enable scaling, configure with --enable-libyuv\n",
vpx_codec_error(&decoder));
- return EXIT_FAILURE;
+ goto fail;
#endif
}
}
fprintf(stderr, "\n");
}
- if (frames_corrupted)
+ if (frames_corrupted) {
fprintf(stderr, "WARNING: %d frames corrupted.\n", frames_corrupted);
+ } else {
+ ret = EXIT_SUCCESS;
+ }
fail:
if (vpx_codec_destroy(&decoder)) {
fprintf(stderr, "Failed to destroy decoder: %s\n",
vpx_codec_error(&decoder));
- return EXIT_FAILURE;
}
+fail2:
+
if (!noblit && single_file) {
if (do_md5) {
MD5Final(md5_digest, &md5_ctx);
fclose(infile);
free(argv);
- return frames_corrupted ? EXIT_FAILURE : EXIT_SUCCESS;
+ return ret;
}
int main(int argc, const char **argv_) {