The two different variants of the threadlib basically are win32 and unix - use _WIN32 to check for this consistently, instead of occasionally using __GNUC__ to enable the unix codepath. (__GNUC__ is also defined on mingw, which still is a windows platform and should use the _WIN32 code.)
Showing the changes to codec/encoder/core/src/encoder_ext.cpp (1 of 6 files). Show all
Unified · Split
| @@ -2171,7 +2171,7 @@ void WelsUninitEncoderExt (sWelsEncCtx** ppCtx) { · 2170 unmodified lines | |||
| 2171 | WelsMultipleEventsWaitAllBlocking (iThreadCount, & (*ppCtx)->pSliceThreading->pFinSliceCodingEvent[0]); | 2171 | WelsMultipleEventsWaitAllBlocking (iThreadCount, & (*ppCtx)->pSliceThreading->pFinSliceCodingEvent[0]); |
| 2172 | 2172 | ||
| 2173 | } | 2173 | } |
| 2174 | #elif defined(__GNUC__) | 2174 | #else |
| 2175 | while (iThreadIdx < iThreadCount) { | 2175 | while (iThreadIdx < iThreadCount) { |
| 2176 | int res = 0; | 2176 | int res = 0; |
| 2177 | if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) { | 2177 | if ((*ppCtx)->pSliceThreading->pThreadHandles[iThreadIdx]) { |
| @@ -3300,7 +3300,7 @@ int32_t WelsEncoderEncodeExt (sWelsEncCtx* pCtx, SFrameBSInfo * pFbi, const SSou · 1122 unmodified lines | |||
| 3300 | } else { | 3300 | } else { |
| 3301 | WelsSleep (1); | 3301 | WelsSleep (1); |
| 3302 | } | 3302 | } |
| 3303 | #else//__GNUC__ | 3303 | #else |
| 3304 | // TODO for pthread platforms | 3304 | // TODO for pthread platforms |
| 3305 | // alternate implementation using blocking due non-blocking with timeout mode not support at wels thread lib, tune back if available | 3305 | // alternate implementation using blocking due non-blocking with timeout mode not support at wels thread lib, tune back if available |
| 3306 | WelsMultipleEventsWaitAllBlocking (iNumThreadsRunning, &pCtx->pSliceThreading->pSliceCodedEvent[0]); | 3306 | WelsMultipleEventsWaitAllBlocking (iNumThreadsRunning, &pCtx->pSliceThreading->pSliceCodedEvent[0]); |