History

make error consistence for memory fail

huili2 committed 9 years ago

Commit 4c74cc81 parent 3c2caa46 files · +56 −35Browse files

Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 6 files). Show all

Unified · Split

codec/decoder/core/src/decoder.cpp+10−7
@@ -475,7 +475,7 @@ void WelsFreeDynamicMemory (PWelsDecoderContext pCtx) { · 474 unmodified lines
475475 /*!
476476 * \brief Open decoder
477477 */
478−int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) {
478+int32_t WelsOpenDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) {
479479 int iRet = ERR_NONE;
480480 // function pointers
481481 InitDecFuncs (pCtx, pCtx->uiCpuFlag);
@@ -485,8 +485,11 @@ int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) { · 3 unmodified lines
485485
486486 // static memory
487487 iRet = WelsInitStaticMemory (pCtx);
488− if (ERR_NONE != iRet)
488+ if (ERR_NONE != iRet) {
489+ pCtx->iErrorCode |= dsOutOfMemory;
490+ WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsInitStaticMemory() failed in WelsOpenDecoder().");
489491 return iRet;
492+ }
490493
491494 #ifdef LONG_TERM_REF
492495 pCtx->bParamSetsLostFlag = true;
@@ -568,7 +571,7 @@ int32_t WelsInitDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { · 75 unmodified lines
568571 }
569572
570573 // open decoder
571− return WelsOpenDecoder (pCtx);
574+ return WelsOpenDecoder (pCtx, pLogCtx);
572575 }
573576
574577 /*!
@@ -817,17 +820,17 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi · 242 unmodified lines
817820 bool bReallocFlag = false;
818821 iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight, bReallocFlag); // common memory used
819822 if (ERR_NONE != iErr) {
820− WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
823+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
821824 "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure.");
822− pCtx->iErrorCode = dsOutOfMemory;
825+ pCtx->iErrorCode |= dsOutOfMemory;
823826 return iErr;
824827 }
825828
826829 iErr = InitialDqLayersContext (pCtx, kiPicWidth, kiPicHeight);
827830 if (ERR_NONE != iErr) {
828− WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING,
831+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR,
829832 "SyncPictureResolutionExt()::InitialDqLayersContext--buffer allocated failure.");
830− pCtx->iErrorCode = dsOutOfMemory;
833+ pCtx->iErrorCode |= dsOutOfMemory;
831834 }
832835 #if defined(MEMORY_MONITOR)
833836 if (bReallocFlag) {

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