Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 2 files). Show all
Unified · Split
| @@ -304,13 +304,13 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 303 unmodified lines | ||
| 304 | 304 | |
| 305 | 305 | iVal = * ((int*)pOption); // int value for error concealment idc |
| 306 | 306 | iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE); |
| 307 | − m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal; | |
| 308 | − if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) { | |
| 307 | + if ((m_pDecContext->bParseOnly) && (iVal != (int32_t) ERROR_CON_DISABLE)) { | |
| 309 | 308 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 310 | 309 | "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal); |
| 311 | 310 | return cmInitParaError; |
| 312 | 311 | } |
| 313 | 312 | |
| 313 | + m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal; | |
| 314 | 314 | InitErrorCon (m_pDecContext); |
| 315 | 315 | WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO, |
| 316 | 316 | "CWelsDecoder::SetOption for ERROR_CON_IDC = %d.", iVal); |
| @@ -438,6 +438,11 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 121 unmodified lines | ||
| 438 | 438 | const int kiSrcLen, |
| 439 | 439 | unsigned char** ppDst, |
| 440 | 440 | SBufferInfo* pDstInfo) { |
| 441 | + if (m_pDecContext->bParseOnly) { | |
| 442 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be false for this API calling! \n"); | |
| 443 | + m_pDecContext->iErrorCode |= dsInvalidArgument; | |
| 444 | + return dsInvalidArgument; | |
| 445 | + } | |
| 441 | 446 | if (CheckBsBuffer (m_pDecContext, kiSrcLen)) { |
| 442 | 447 | return dsOutOfMemory; |
| 443 | 448 | } |
| @@ -578,6 +583,11 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 134 unmodified lines | ||
| 578 | 583 | DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc, |
| 579 | 584 | const int kiSrcLen, |
| 580 | 585 | SParserBsInfo* pDstInfo) { |
| 586 | + if (!m_pDecContext->bParseOnly) { | |
| 587 | + WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_ERROR, "bParseOnly should be true for this API calling! \n"); | |
| 588 | + m_pDecContext->iErrorCode |= dsInvalidArgument; | |
| 589 | + return dsInvalidArgument; | |
| 590 | + } | |
| 581 | 591 | if (CheckBsBuffer (m_pDecContext, kiSrcLen)) { |
| 582 | 592 | return dsOutOfMemory; |
| 583 | 593 | } |