ref: 69a62ea58ec64c5e2d6c7f3d8f8ed4659a45cb85
parent: 12d50ad5651cdaa8a95186aa74ce756d4df39876
parent: 28d7d303e3a010689a8c9656c2cf8eb7dc50b7a5
author: huili2 <huili2@cisco.com>
date: Fri Sep 11 06:17:40 EDT 2015
Merge pull request #2108 from HaiboZhu/Bugfix_ResetDecoder Bug fix with add DecoderConfigParam in ResetDecoder
--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -264,7 +264,14 @@
if (m_pDecContext != NULL && m_pWelsTrace != NULL) {
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, "ResetDecoder(), context error code is %d",
m_pDecContext->iErrorCode);
- return InitDecoder (m_pDecContext->bParseOnly);
+ SDecodingParam sPrevParam;
+ memcpy (&sPrevParam, m_pDecContext->pParam, sizeof (SDecodingParam));
+
+ int32_t iRet = InitDecoder (m_pDecContext->bParseOnly);
+ if (iRet)
+ return iRet;
+
+ return DecoderConfigParam (m_pDecContext, &sPrevParam);
} else if (m_pWelsTrace != NULL) {
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "ResetDecoder() failed as decoder context null");
}
@@ -308,7 +315,7 @@
iVal = * ((int*)pOption); // int value for error concealment idc
iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE);
- m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal;
+ m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal;
if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) {
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
"CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);