fix issue #1535 new
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -2272,20 +2272,18 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 2271 unmodified lines | |||
| 2272 | const int32_t iThreadCount = (*ppCtx)->pSvcParam->iCountThreadsNum; | 2272 | const int32_t iThreadCount = (*ppCtx)->pSvcParam->iCountThreadsNum; |
| 2273 | int32_t iThreadIdx = 0; | 2273 | int32_t iThreadIdx = 0; |
| 2274 | 2274 | ||
| 2275 | if ((*ppCtx)->pSliceThreading->pExitEncodeEvent != NULL) { | 2275 | while (iThreadIdx < iThreadCount) { |
| 2276 | while (iThreadIdx < iThreadCount) { | 2276 | int res = 0; |
| 2277 | int res = 0; | 2277 | if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) { |
| 2278 | if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) { | 2278 | WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]); |
| 2279 | WelsEventSignal (& (*ppCtx)->pSliceThreading->pExitEncodeEvent[iThreadIdx]); | 2279 | WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]); |
| 2280 | WelsEventSignal (& (*ppCtx)->pSliceThreading->pThreadMasterEvent[iThreadIdx]); | 2280 | res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit |
| 2281 | res = WelsThreadJoin ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]); // waiting thread exit | 2281 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..", |
| 2282 | WelsLog (& (*ppCtx)->sLogCtx, WELS_LOG_INFO, "WelsUninitEncoderExt(), pthread_join(pThreadHandles%d) return %d..", | 2282 | iThreadIdx, |
| 2283 | iThreadIdx, | 2283 | res); |
| 2284 | res); | 2284 | (*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx] = 0; |
| 2285 | (*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx] = 0; | ||
| 2286 | } | ||
| 2287 | ++ iThreadIdx; | ||
| 2288 | } | 2285 | } |
| 2286 | ++ iThreadIdx; | ||
| 2289 | } | 2287 | } |
| 2290 | } | 2288 | } |
| 2291 | 2289 | ||