summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjkaup <[email protected]>2024-07-14 00:10:28 +0300
committerGitHub <[email protected]>2024-07-13 23:10:28 +0200
commit5ede47618bd9f9a440af648da1b4817e51644994 (patch)
treedb826d34ae43d6918e3809ba6622c10b066889dc
parent8d5374a443509036063a350d1649408e009425e7 (diff)
downloadraylib-5ede47618bd9f9a440af648da1b4817e51644994.tar.gz
raylib-5ede47618bd9f9a440af648da1b4817e51644994.zip
Fix crash when switching playback device (#4102)
Co-authored-by: jj <[email protected]>
-rw-r--r--src/external/miniaudio.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/external/miniaudio.h b/src/external/miniaudio.h
index 47332e11..787c626a 100644
--- a/src/external/miniaudio.h
+++ b/src/external/miniaudio.h
@@ -21473,7 +21473,9 @@ static ma_result ma_context_get_MMDevice__wasapi(ma_context* pContext, ma_device
MA_ASSERT(pContext != NULL);
MA_ASSERT(ppMMDevice != NULL);
+ ma_CoInitializeEx(pContext, NULL, MA_COINIT_VALUE);
hr = ma_CoCreateInstance(pContext, &MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, &MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator);
+ ma_CoUninitialize(pContext);
if (FAILED(hr)) {
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create IMMDeviceEnumerator.\n");
return ma_result_from_HRESULT(hr);