ref: a5cb0ea22c6e3a386b19463a0973ebc3afa570bf
parent: 3a91abf28c08aa7572d96e37e08b1e951ae2ce8c
parent: 900a90892918acb190c85a8914d71055de93be35
author: dongzha <dongzha@cisco.com>
date: Fri Jan 9 04:23:55 EST 2015
Merge pull request #1711 from huili2/parseonly_noEC disable EC for parseonly
--- a/codec/decoder/plus/src/welsDecoderExt.cpp
+++ b/codec/decoder/plus/src/welsDecoderExt.cpp
@@ -285,6 +285,12 @@
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;
+ 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);
+ return cmInitParaError;
+ }
+
InitErrorCon (m_pDecContext);
WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
"CWelsDecoder::SetOption for ERROR_CON_IDC = %d.", iVal);
@@ -551,6 +557,7 @@
}
m_pDecContext->iErrorCode = dsErrorFree; //initialize at the starting of AU decoding.
+ m_pDecContext->eErrorConMethod = ERROR_CON_DISABLE; //add protection to disable EC here.
m_pDecContext->pParserBsInfo = pDstInfo;
pDstInfo->iNalNum = 0;
pDstInfo->iSpsWidthInPixel = pDstInfo->iSpsHeightInPixel = 0;