From: Jim Bankoski Date: Mon, 24 Oct 2016 19:05:59 +0000 (-0700) Subject: vpxdec: return fail if frame fails to decode. X-Git-Tag: v1.6.1~151^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ef094c02f261f3599072eb1fa9aaa2477f9d47e;p=libvpx vpxdec: return fail if frame fails to decode. A failure to decode is most likely equivalent to a corrupt frame for the purpose of returning a failure. Change-Id: Ie53db2b8130b40b725841f5f7a299d63aa56913d --- diff --git a/vpxdec.c b/vpxdec.c index d1ed3e6ca..4bd16bbed 100644 --- a/vpxdec.c +++ b/vpxdec.c @@ -9,11 +9,11 @@ */ #include +#include +#include #include #include -#include #include -#include #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); warn("Failed to decode frame %d: %s", frame_in, vpx_codec_error(&decoder)); - if (detail) warn("Additional information: %s", detail); + frames_corrupted++; 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. if (vpx_codec_decode(&decoder, NULL, 0, NULL, 0)) { warn("Failed to flush decoder: %s", vpx_codec_error(&decoder)); + frames_corrupted++; + if (!keep_going) goto fail; } }