shithub: openh264

Download patch

ref: ef590de0dcd14f4a2c27b90aa2b5a6c60c04adff
parent: 684c42536dffb826e70d6ea527d0c07baa8efb85
parent: 881667a5335df2450eed78315b3a7b1fd5bebd6d
author: dongzha <[email protected]>
date: Fri Sep 5 10:18:16 EDT 2014

Merge pull request #1335 from lyao2/fixppsbug

fix pps caused death loop issue

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2680,7 +2680,6 @@
   //31st finish:	next_spsid_in_bs == 1;
 
   const int32_t kiEncId			= kiCurEncoderParaSetId;
-  const bool* kpUsedIdPointer   = &sParaSetOffsetVariable->bUsedParaSetIdInBs[0];
   uint32_t uiNextIdInBs			= sParaSetOffsetVariable->uiNextParaSetIdToUseInBs;
 
   //update current layer's pCodingParam
@@ -2691,20 +2690,12 @@
 
   //prepare for next update:
   //   find the next avaibable iId
-  do {
-    ++uiNextIdInBs;
-    if (uiNextIdInBs >= kuiMaxIdInBs) {
-      uiNextIdInBs = 0;//ensure the SPS_ID wound not exceed MAX_SPS_COUNT
-    }
-  } while (kpUsedIdPointer[uiNextIdInBs]);
-
+  ++uiNextIdInBs;
+  if (uiNextIdInBs >= kuiMaxIdInBs) {
+    uiNextIdInBs = 0;//ensure the SPS_ID wound not exceed MAX_SPS_COUNT
+  }
   //   update next_id
   sParaSetOffsetVariable->uiNextParaSetIdToUseInBs = uiNextIdInBs;
-
-#if _DEBUG
-  assert (!sParaSetOffsetVariable->bUsedParaSetIdInBs[uiNextIdInBs]);   //sure the next-to-use one is marked activated correctly
-#endif
-
 }
 
 /*!