shithub: openh264

Download patch

ref: b86e1f00b2d6cd06eae0c8321754ef53190f2400
parent: a29645cefed4a1befa641b9756c95b438449f1ac
parent: 821483a4e9173c442c368f1ebef8eef6c376faf6
author: huili2 <huili2@cisco.com>
date: Wed Jul 9 13:26:59 EDT 2014

Merge pull request #1127 from ruil2/temporal_bug_fix

fix bug when temporal layer changes

--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3718,7 +3718,10 @@
     pOldParam->bPrefixNalAddingCtrl = pNewParam->bPrefixNalAddingCtrl;
     pOldParam->iNumRefFrame		= pNewParam->iNumRefFrame;		// number of reference frame used
     pOldParam->uiGopSize = pNewParam->uiGopSize;
-    pOldParam->iTemporalLayerNum = pNewParam->iTemporalLayerNum;
+    if (pOldParam->iTemporalLayerNum != pNewParam->iTemporalLayerNum) {
+      pOldParam->iTemporalLayerNum = pNewParam->iTemporalLayerNum;
+      (*ppCtx)->iCodingIndex = 0;
+    }
     pOldParam->iDecompStages = pNewParam->iDecompStages;
     /* denoise control */
     pOldParam->bEnableDenoise	= pNewParam->bEnableDenoise;