ref: 0252f3f346833b64a4996b49e52d79a2c43b0ba0
parent: b05a52be7ac2b1654220f8bb7c0e5f778eb5707d
parent: 66165a65d5e204ca8db31220aa7e3523d79b569a
author: sijchen <sijchen@cisco.com>
date: Mon Nov 17 11:43:45 EST 2014
Merge pull request #1526 from ruil2/max_nal_size add return value processing
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2086,9 +2086,14 @@
return iRet;
}
- if (pCodingParam->iMultipleThreadIdc > 1)
+ if (pCodingParam->iMultipleThreadIdc > 1) {
iRet = CreateSliceThreads (pCtx);
-
+ if (iRet != 0) {
+ WelsLog (pLogCtx, WELS_LOG_ERROR, "WelsInitEncoderExt(), CreateSliceThreads failed return %d.", iRet);
+ FreeMemorySvc (&pCtx);
+ return iRet;
+ }
+ }
if (pCodingParam->iEntropyCodingModeFlag)
WelsCabacInit (pCtx);
WelsRcInitModule (pCtx, pCtx->pSvcParam->iRCMode);
--- a/codec/encoder/core/src/slice_multi_threading.cpp
+++ b/codec/encoder/core/src/slice_multi_threading.cpp
@@ -963,8 +963,11 @@
int32_t iIdx = 0;
while (iIdx < kiThreadCount) {
- WelsThreadCreate (&pCtx->pSliceThreading->pThreadHandles[iIdx], CodingSliceThreadProc,
- &pCtx->pSliceThreading->pThreadPEncCtx[iIdx], 0);
+ if (WelsThreadCreate (&pCtx->pSliceThreading->pThreadHandles[iIdx], CodingSliceThreadProc,
+ &pCtx->pSliceThreading->pThreadPEncCtx[iIdx], 0)) {
+ return 1;
+ }
+
++ iIdx;
}