Merge "vpxdec: return fail if frame fails to decode."

This commit is contained in:
James Bankoski 2016-10-25 18:34:06 +00:00 committed by Gerrit Code Review
commit f53d3363ac

View File

@ -9,11 +9,11 @@
*/ */
#include <assert.h> #include <assert.h>
#include <limits.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h>
#include <string.h> #include <string.h>
#include <limits.h>
#include "./vpx_config.h" #include "./vpx_config.h"
@ -780,8 +780,8 @@ static int main_loop(int argc, const char **argv_) {
const char *detail = vpx_codec_error_detail(&decoder); const char *detail = vpx_codec_error_detail(&decoder);
warn("Failed to decode frame %d: %s", frame_in, warn("Failed to decode frame %d: %s", frame_in,
vpx_codec_error(&decoder)); vpx_codec_error(&decoder));
if (detail) warn("Additional information: %s", detail); if (detail) warn("Additional information: %s", detail);
frames_corrupted++;
if (!keep_going) goto fail; if (!keep_going) goto fail;
} }
@ -800,6 +800,8 @@ static int main_loop(int argc, const char **argv_) {
// Flush the decoder in frame parallel decode. // Flush the decoder in frame parallel decode.
if (vpx_codec_decode(&decoder, NULL, 0, NULL, 0)) { if (vpx_codec_decode(&decoder, NULL, 0, NULL, 0)) {
warn("Failed to flush decoder: %s", vpx_codec_error(&decoder)); warn("Failed to flush decoder: %s", vpx_codec_error(&decoder));
frames_corrupted++;
if (!keep_going) goto fail;
} }
} }