Skip to content

Commit

Permalink
Fix crash when switching playback device (#4102)
Browse files Browse the repository at this point in the history
Co-authored-by: jj <[email protected]>
  • Loading branch information
jkaup and jj committed Jul 13, 2024
1 parent 8d5374a commit 5ede476
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/external/miniaudio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5ede476

Please sign in to comment.