Web Audio: Enable threading in ma_engine if compiling with -pthread.

With this commit, when targeting pthreads with the -pthread, the engine
will allow threading with it's internal resource manager.

Public issue https://github.com/mackron/miniaudio/issues/855
This commit is contained in:
David Reid
2025-01-11 13:00:33 +10:00
parent ae2cd4bea4
commit 928ed8bd85
+2 -2
View File
@@ -75690,8 +75690,8 @@ MA_API ma_result ma_engine_init(const ma_engine_config* pConfig, ma_engine* pEng
ma_allocation_callbacks_init_copy(&resourceManagerConfig.allocationCallbacks, &pEngine->allocationCallbacks);
resourceManagerConfig.pVFS = engineConfig.pResourceManagerVFS;
/* The Emscripten build cannot use threads. */
#if defined(MA_EMSCRIPTEN)
/* The Emscripten build cannot use threads unless it's targeting pthreads. */
#if defined(MA_EMSCRIPTEN) && !defined(__EMSCRIPTEN_PTHREADS__)
{
resourceManagerConfig.jobThreadCount = 0;
resourceManagerConfig.flags |= MA_RESOURCE_MANAGER_FLAG_NO_THREADING;