From 0930bebcf2cc04e74eb11314f918d00b0d99558a Mon Sep 17 00:00:00 2001 From: Jozef Chutka Date: Tue, 27 Jun 2023 13:24:22 +0200 Subject: [PATCH] emscripten processor count --- codec/common/src/WelsThreadLib.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/codec/common/src/WelsThreadLib.cpp b/codec/common/src/WelsThreadLib.cpp index 5c5cfcdd6..b1072e0c9 100644 --- a/codec/common/src/WelsThreadLib.cpp +++ b/codec/common/src/WelsThreadLib.cpp @@ -48,7 +48,9 @@ #include #include #include -#ifndef __Fuchsia__ +#ifdef __EMSCRIPTEN__ +#include +#elif !defined(__Fuchsia__) #include #endif #ifdef __APPLE__ @@ -508,7 +510,7 @@ WELS_THREAD_ERROR_CODE WelsQueryLogicalProcessInfo (WelsLogicalProcessInfo* p #elif defined(__EMSCRIPTEN__) // There is not yet a way to determine CPU count in emscripten JS environment. - pInfo->ProcessorCount = 1; + pInfo->ProcessorCount = emscripten_num_logical_cores(); return WELS_THREAD_ERROR_OK; #elif defined(__Fuchsia__)