From 13126b4ddfe39d02dc84689c86cbbb61fc1ffdf3 Mon Sep 17 00:00:00 2001 From: David Reid Date: Sun, 17 Jan 2021 18:18:14 +1000 Subject: [PATCH] Fix a bug with the resource manager. This was not setting the NON_BLOCKING flag correctly when NO_THREADING is set. --- research/miniaudio_engine.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/research/miniaudio_engine.h b/research/miniaudio_engine.h index fe7566d6..93fdd4d3 100644 --- a/research/miniaudio_engine.h +++ b/research/miniaudio_engine.h @@ -5529,8 +5529,8 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon /* Job queue. */ jobQueueFlags = 0; - if ((pConfig->flags & MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING) != 0) { - if (pConfig->jobThreadCount > 0) { + if ((pResourceManager->config.flags & MA_RESOURCE_MANAGER_FLAG_NON_BLOCKING) != 0) { + if (pResourceManager->config.jobThreadCount > 0) { return MA_INVALID_ARGS; /* Non-blocking mode is only valid for self-managed job threads. */ } @@ -5552,7 +5552,7 @@ MA_API ma_result ma_resource_manager_init(const ma_resource_manager_config* pCon } /* Create the job threads last to ensure the threads has access to valid data. */ - for (iJobThread = 0; iJobThread < pConfig->jobThreadCount; iJobThread += 1) { + for (iJobThread = 0; iJobThread < pResourceManager->config.jobThreadCount; iJobThread += 1) { result = ma_thread_create(&pResourceManager->jobThreads[iJobThread], ma_thread_priority_normal, 0, ma_resource_manager_job_thread, pResourceManager); if (result != MA_SUCCESS) { ma_mutex_uninit(&pResourceManager->dataBufferBSTLock);