History

disable wrongly calling for parseonly related

huili2 committed 10 years ago

Commit 9fade101 parent 2d3071e2 files · +106 −11Browse files

Showing the changes to codec/decoder/plus/src/welsDecoderExt.cpp (1 of 2 files). Show all

Unified · Split

codec/decoder/plus/src/welsDecoderExt.cpp+12−2
@@ -304,13 +304,13 @@ long CWelsDecoder::SetOption (DECODER_OPTION eOptID, void* pOption) { · 303 unmodified lines
304 304
305 iVal = * ((int*)pOption); // int value for error concealment idc305 iVal = * ((int*)pOption); // int value for error concealment idc
306 iVal = WELS_CLIP3 (iVal, (int32_t) ERROR_CON_DISABLE, (int32_t) ERROR_CON_SLICE_MV_COPY_CROSS_IDR_FREEZE_RES_CHANGE);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;307 if ((m_pDecContext->bParseOnly) && (iVal != (int32_t) ERROR_CON_DISABLE)) {
308 if ((m_pDecContext->bParseOnly) && (m_pDecContext->eErrorConMethod != ERROR_CON_DISABLE)) {
309 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,308 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
310 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);309 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);
311 return cmInitParaError;310 return cmInitParaError;
312 }311 }
313 312
313 m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal;
314 InitErrorCon (m_pDecContext);314 InitErrorCon (m_pDecContext);
315 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,315 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
316 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d.", iVal);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 const int kiSrcLen,438 const int kiSrcLen,
439 unsigned char** ppDst,439 unsigned char** ppDst,
440 SBufferInfo* pDstInfo) {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 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {446 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {
442 return dsOutOfMemory;447 return dsOutOfMemory;
443 }448 }
@@ -578,6 +583,11 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 134 unmodified lines
578DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc,583DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc,
579 const int kiSrcLen,584 const int kiSrcLen,
580 SParserBsInfo* pDstInfo) {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 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {591 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {
582 return dsOutOfMemory;592 return dsOutOfMemory;
583 }593 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t