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
304304
305305 iVal = * ((int*)pOption); // int value for error concealment idc
306306 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)) {
309308 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
310309 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d not allowd for parse only!.", iVal);
311310 return cmInitParaError;
312311 }
313312
313+ m_pDecContext->pParam->eEcActiveIdc = m_pDecContext->eErrorConMethod = (ERROR_CON_IDC) iVal;
314314 InitErrorCon (m_pDecContext);
315315 WelsLog (&m_pWelsTrace->m_sLogCtx, WELS_LOG_INFO,
316316 "CWelsDecoder::SetOption for ERROR_CON_IDC = %d.", iVal);
@@ -438,6 +438,11 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 121 unmodified lines
438438 const int kiSrcLen,
439439 unsigned char** ppDst,
440440 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+ }
441446 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {
442447 return dsOutOfMemory;
443448 }
@@ -578,6 +583,11 @@ DECODING_STATE CWelsDecoder::DecodeFrame2 (const unsigned char* kpSrc, · 134 unmodified lines
578583 DECODING_STATE CWelsDecoder::DecodeParser (const unsigned char* kpSrc,
579584 const int kiSrcLen,
580585 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+ }
581591 if (CheckBsBuffer (m_pDecContext, kiSrcLen)) {
582592 return dsOutOfMemory;
583593 }

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