shithub: openh264

Download patch

ref: 596be02cc476b8882a39cf318d5faf5505a0814c
parent: 8247eef9bb0962608f70ec217c3891d2018d8714
author: jwwang <[email protected]>
date: Sat Jan 18 04:54:12 EST 2014

Fix incomplete decocder output for not flushing the temp file

--- a/test/decode_encode_test.cpp
+++ b/test/decode_encode_test.cpp
@@ -56,10 +56,6 @@
   }
 
   virtual void TearDown() {
-    if (tmpFile_ != NULL) {
-      fclose(tmpFile_);
-      remove(tmpFileName_);
-    }
     BaseDecoderTest::TearDown();
     BaseEncoderTest::TearDown();
   }
@@ -91,6 +87,9 @@
     return;
   }
 
+  // force flushing the file
+  fclose(tmpFile_);
+
   EncodeFile(tmpFileName_, p.width, p.height, p.frameRate, this);
   unsigned char digest[SHA_DIGEST_LENGTH];
   SHA1_Final(digest, &ctx_);
@@ -97,11 +96,13 @@
   if (!HasFatalFailure()) {
     ASSERT_TRUE(CompareHash(digest, p.hashStr));
   }
+
+  remove(tmpFileName_);
 }
 
 static const DecodeEncodeFileParam kFileParamArray[] = {
-  {"res/test_vd_1d.264", "c17a760c3bc5d8682aae7f49dddebd2593071711", 320, 192, 12.0f},
-  {"res/test_vd_rc.264", "41e3e90f159fade7a89a4540c4fb9f8ac8f4d7da", 320, 192, 12.0f},
+  {"res/test_vd_1d.264", "41c672107cfe9e8e8a67b5d08cbd701f6c982ccd", 320, 192, 12.0f},
+  {"res/test_vd_rc.264", "d546ea7c671b42503f8a46ba50bef2a3eaca4c5a", 320, 192, 12.0f},
 };
 
 INSTANTIATE_TEST_CASE_P(DecodeEncodeFile, DecodeEncodeTest,