From 28d7d303e3a010689a8c9656c2cf8eb7dc50b7a5 Mon Sep 17 00:00:00 2001 From: Haibo Zhu Date: Thu, 10 Sep 2015 16:47:37 +0800 Subject: [PATCH] Bug fix with add DecoderConfigParam in ResetDecoder --- codec/decoder/plus/src/welsDecoderExt.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/codec/decoder/plus/src/welsDecoderExt.cpp b/codec/decoder/plus/src/welsDecoderExt.cpp index 0d7db281..fe04f9ed 100644 --- a/codec/decoder/plus/src/welsDecoderExt.cpp +++ b/codec/decoder/plus/src/welsDecoderExt.cpp @@ -264,7 +264,14 @@ int32_t CWelsDecoder::ResetDecoder() { 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 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { 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);