From: Yaowu Xu Date: Wed, 16 Oct 2013 23:29:28 +0000 (-0700) Subject: Prevent first pass from outputing invalid info X-Git-Tag: v1.3.0~198^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=47e784eab68f385b0f2bf85b1a495cd110850484;p=libvpx Prevent first pass from outputing invalid info First pass does not produce compressed data, therefore encode/decode match check is not initialized. Change-Id: I1971a6747337872a850987cc70ba267bd0f1d564 --- diff --git a/vpxenc.c b/vpxenc.c index d7c6c0e3d..aa99c6b7c 100644 --- a/vpxenc.c +++ b/vpxenc.c @@ -2784,16 +2784,17 @@ int main(int argc, const char **argv_) { /* TODO(jkoleszar): This doesn't belong in this executable. Do it for now, * to match some existing utilities. */ - FOREACH_STREAM({ - FILE *f = fopen("opsnr.stt", "a"); - if (stream->mismatch_seen) { - fprintf(f, "First mismatch occurred in frame %d\n", - stream->mismatch_seen); - } else { - fprintf(f, "No mismatch detected in recon buffers\n"); - } - fclose(f); - }); + if (!(global.pass == 1 && global.passes == 2)) + FOREACH_STREAM({ + FILE *f = fopen("opsnr.stt", "a"); + if (stream->mismatch_seen) { + fprintf(f, "First mismatch occurred in frame %d\n", + stream->mismatch_seen); + } else { + fprintf(f, "No mismatch detected in recon buffers\n"); + } + fclose(f); + }); #endif vpx_img_free(&raw);