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 | * \brief Open decoder | 476 | * \brief Open decoder |
| 477 | */ | 477 | */ |
| 478 | int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) { | 478 | int32_t WelsOpenDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { |
| 479 | int iRet = ERR_NONE; | 479 | int iRet = ERR_NONE; |
| 480 | // function pointers | 480 | // function pointers |
| 481 | InitDecFuncs (pCtx, pCtx->uiCpuFlag); | 481 | InitDecFuncs (pCtx, pCtx->uiCpuFlag); |
| @@ -485,8 +485,11 @@ int32_t WelsOpenDecoder (PWelsDecoderContext pCtx) { · 3 unmodified lines | |||
| 485 | 485 | ||
| 486 | // static memory | 486 | // static memory |
| 487 | iRet = WelsInitStaticMemory (pCtx); | 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 | return iRet; | 491 | return iRet; |
| 492 | } | ||
| 490 | 493 | ||
| 491 | #ifdef LONG_TERM_REF | 494 | #ifdef LONG_TERM_REF |
| 492 | pCtx->bParamSetsLostFlag = true; | 495 | pCtx->bParamSetsLostFlag = true; |
| @@ -568,7 +571,7 @@ int32_t WelsInitDecoder (PWelsDecoderContext pCtx, SLogContext* pLogCtx) { · 75 unmodified lines | |||
| 568 | } | 571 | } |
| 569 | 572 | ||
| 570 | // open decoder | 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 | bool bReallocFlag = false; | 820 | bool bReallocFlag = false; |
| 818 | iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight, bReallocFlag); // common memory used | 821 | iErr = WelsRequestMem (pCtx, kiMbWidth, kiMbHeight, bReallocFlag); // common memory used |
| 819 | if (ERR_NONE != iErr) { | 822 | if (ERR_NONE != iErr) { |
| 820 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | 823 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, |
| 821 | "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure."); | 824 | "SyncPictureResolutionExt()::WelsRequestMem--buffer allocated failure."); |
| 822 | pCtx->iErrorCode = dsOutOfMemory; | 825 | pCtx->iErrorCode |= dsOutOfMemory; |
| 823 | return iErr; | 826 | return iErr; |
| 824 | } | 827 | } |
| 825 | 828 | ||
| 826 | iErr = InitialDqLayersContext (pCtx, kiPicWidth, kiPicHeight); | 829 | iErr = InitialDqLayersContext (pCtx, kiPicWidth, kiPicHeight); |
| 827 | if (ERR_NONE != iErr) { | 830 | if (ERR_NONE != iErr) { |
| 828 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, | 831 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, |
| 829 | "SyncPictureResolutionExt()::InitialDqLayersContext--buffer allocated failure."); | 832 | "SyncPictureResolutionExt()::InitialDqLayersContext--buffer allocated failure."); |
| 830 | pCtx->iErrorCode = dsOutOfMemory; | 833 | pCtx->iErrorCode |= dsOutOfMemory; |
| 831 | } | 834 | } |
| 832 | #if defined(MEMORY_MONITOR) | 835 | #if defined(MEMORY_MONITOR) |
| 833 | if (bReallocFlag) { | 836 | if (bReallocFlag) { |