|
|
@ -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); |
|
|
|