shithub: openh264

Download patch

ref: 182ae421a1cca65d59c21d1d5dbd0a1de2ed522c
parent: ac992acaa944e4c188b9d82262c9f859ba7a4762
parent: 590eef6059091b16ee80a9dc70cca6104567d0c8
author: huili2 <[email protected]>
date: Wed Dec 17 06:18:11 EST 2014

Merge pull request #1647 from HaiboZhu/Debug_Check_Ref_Picture_Complete

Change the name and call logic of CheckRefPicturesComplete function

--- a/codec/decoder/core/inc/decoder_core.h
+++ b/codec/decoder/core/inc/decoder_core.h
@@ -157,7 +157,7 @@
 void ForceResetCurrentAccessUnit (PAccessUnit pAu);
 void ForceClearCurrentNal (PAccessUnit pAu);
 
-bool bCheckRefPicturesComplete (PWelsDecoderContext pCtx); // Check whether all ref pictures are complete
+bool CheckRefPicturesComplete (PWelsDecoderContext pCtx); // Check whether all ref pictures are complete
 
 void ForceResetParaSetStatusAndAUList(PWelsDecoderContext pCtx);
 } // namespace WelsDec
--- a/codec/decoder/core/src/decoder_core.cpp
+++ b/codec/decoder/core/src/decoder_core.cpp
@@ -2061,8 +2061,12 @@
             }
           }
         }
-        if (bAllRefComplete && (pCtx->sRefPic.uiRefCount[LIST_0] > 0 || pCtx->eSliceType != I_SLICE)) {
-          bAllRefComplete &= bCheckRefPicturesComplete (pCtx);
+        if (bAllRefComplete && pCtx->eSliceType != I_SLICE) {
+          if (pCtx->sRefPic.uiRefCount[LIST_0] > 0) {
+            bAllRefComplete &= CheckRefPicturesComplete (pCtx);
+          } else {
+            bAllRefComplete = false;
+          }
         }
       }
 #if defined (_DEBUG) &&  !defined (CODEC_FOR_TESTBED)
@@ -2182,7 +2186,7 @@
   return ERR_NONE;
 }
 
-bool bCheckRefPicturesComplete (PWelsDecoderContext pCtx) {
+bool CheckRefPicturesComplete (PWelsDecoderContext pCtx) {
   // Multi Reference, RefIdx may differ
   bool bAllRefComplete = true;
   int32_t iRealMbIdx;