fix crash issue that temporal layer changs cause memory issue
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 2 files). Show all
Unified · Split
| @@ -4181,7 +4181,8 @@ int32_t WelsEncoderParamAdjust (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pNewPa · 4180 unmodified lines | |||
| 4181 | (pOldParam->bEnableBackgroundDetection != pNewParam->bEnableBackgroundDetection) || | 4181 | (pOldParam->bEnableBackgroundDetection != pNewParam->bEnableBackgroundDetection) || |
| 4182 | (pOldParam->bEnableAdaptiveQuant != pNewParam->bEnableAdaptiveQuant) || | 4182 | (pOldParam->bEnableAdaptiveQuant != pNewParam->bEnableAdaptiveQuant) || |
| 4183 | (pOldParam->eSpsPpsIdStrategy != pNewParam->eSpsPpsIdStrategy); | 4183 | (pOldParam->eSpsPpsIdStrategy != pNewParam->eSpsPpsIdStrategy); |
| 4184 | if (pNewParam->iMaxNumRefFrame > pOldParam->iMaxNumRefFrame) { | 4184 | if ((pNewParam->iMaxNumRefFrame > pOldParam->iMaxNumRefFrame) || |
| 4185 | ((pOldParam->iMaxNumRefFrame == 1) && (pOldParam->iTemporalLayerNum == 1) && (pNewParam->iTemporalLayerNum == 2))) { | ||
| 4185 | bNeedReset = true; | 4186 | bNeedReset = true; |
| 4186 | } | 4187 | } |
| 4187 | if (bNeedReset) { | 4188 | if (bNeedReset) { |