Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 6 files). Show all
Unified · Split
| @@ -475,7 +475,7 @@ void WelsFreeDynamicMemory (PWelsDecoderContext pCtx) { · 474 unmodified lines | ||
| 475 | 475 | /*! |
| 476 | 476 | * \brief Open decoder |
| 477 | 477 | */ |
| 478 | −int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) { | |
| 478 | +int32_t WelsOpenDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { | |
| 479 | 479 | int iRet = ERR_NONE; |
| 480 | 480 | // function pointers |
| 481 | 481 | InitDecFuncs (pCtx, pCtx->uiCpuFlag); |
| @@ -485,8 +485,11 @@ int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) { · 3 unmodified lines | ||
| 485 | 485 | |
| 486 | 486 | // static memory |
| 487 | 487 | 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()."); | |
| 489 | 491 | return iRet; |
| 492 | + } | |
| 490 | 493 | |
| 491 | 494 | #ifdef LONG_TERM_REF |
| 492 | 495 | pCtx->bParamSetsLostFlag = true; |
| @@ -568,7 +571,7 @@ int32_t WelsInitDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { · 75 unmodified lines | ||
| 568 | 571 | } |
| 569 | 572 | |
| 570 | 573 | // open decoder |
| 571 | − return WelsOpenDecoder (pCtx); | |
| 574 | + return WelsOpenDecoder (pCtx, pLogCtx); | |
| 572 | 575 | } |
| 573 | 576 | |
| 574 | 577 | /*! |
| @@ -817,17 +820,17 @@ int32_t SyncPictureResolutionExt (PWelsDecoderContext pCtx, const int32_t kiMbWi · 242 unmodified lines | ||
| 817 | 820 | bool bReallocFlag = false; |
| 818 | 821 | iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight, bReallocFlag); // common memory used |
| 819 | 822 | if (ERR_NONE != iErr) { |
| 820 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 823 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, | |
| 821 | 824 | "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure."); |
| 822 | − pCtx->iErrorCode = dsOutOfMemory; | |
| 825 | + pCtx->iErrorCode |= dsOutOfMemory; | |
| 823 | 826 | return iErr; |
| 824 | 827 | } |
| 825 | 828 | |
| 826 | 829 | iErr = InitialDqLayersContext (pCtx, kiPicWidth, kiPicHeight); |
| 827 | 830 | if (ERR_NONE != iErr) { |
| 828 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | |
| 831 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, | |
| 829 | 832 | "SyncPictureResolutionExt()::InitialDqLayersContext--buffer allocated failure."); |
| 830 | − pCtx->iErrorCode = dsOutOfMemory; | |
| 833 | + pCtx->iErrorCode |= dsOutOfMemory; | |
| 831 | 834 | } |
| 832 | 835 | #if defined(MEMORY_MONITOR) |
| 833 | 836 | if (bReallocFlag) { |