Do a blocking wait with WelsMultipleEventsWaitSingleBlocking
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 1 file). Show all
Unified · Split
| @@ -3280,7 +3280,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 3279 unmodified lines | |||
| 3280 | 3280 | ||
| 3281 | lwait = WelsMultipleEventsWaitSingleBlocking (iNumThreadsScheduled, | 3281 | lwait = WelsMultipleEventsWaitSingleBlocking (iNumThreadsScheduled, |
| 3282 | &pCtx->pSliceThreading->pSliceCodedEvent[0], | 3282 | &pCtx->pSliceThreading->pSliceCodedEvent[0], |
| 3283 | 2); // 2 ms for one tick | 3283 | (uint32_t) -1); |
| 3284 | iEventId = (int32_t) (lwait - WELS_THREAD_ERROR_WAIT_OBJECT_0); | 3284 | iEventId = (int32_t) (lwait - WELS_THREAD_ERROR_WAIT_OBJECT_0); |
| 3285 | if (iEventId >= 0 && iEventId < iNumThreadsScheduled) { | 3285 | if (iEventId >= 0 && iEventId < iNumThreadsScheduled) { |
| 3286 | if (iIndexOfSliceToBeCoded < iSliceCount) { | 3286 | if (iIndexOfSliceToBeCoded < iSliceCount) { |
| @@ -3293,8 +3293,6 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 6 unmodified lines | |||
| 3293 | } else { // no other slices left for coding | 3293 | } else { // no other slices left for coding |
| 3294 | -- iNumThreadsRunning; | 3294 | -- iNumThreadsRunning; |
| 3295 | } | 3295 | } |
| 3296 | } else { | ||
| 3297 | WelsSleep (1); | ||
| 3298 | } | 3296 | } |
| 3299 | #else | 3297 | #else |
| 3300 | // TODO for pthread platforms | 3298 | // TODO for pthread platforms |