Commit 394d3157 authored by David Reid's avatar David Reid

Another attempted fix for process loopback mode.

Public issue https://github.com/mackron/miniaudio/issues/484
parent 24950dc1
...@@ -20816,24 +20816,24 @@ static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, m ...@@ -20816,24 +20816,24 @@ static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, m
MA_ASSERT(ppAudioClient != NULL); MA_ASSERT(ppAudioClient != NULL);
if (pDeviceID != NULL) { if (pDeviceID != NULL) {
MA_COPY_MEMORY(&iid, pDeviceID->wasapi, sizeof(iid)); iidStr = (LPOLESTR)pDeviceID->wasapi;
} else { } else {
if (deviceType == ma_device_type_capture) { if (deviceType == ma_device_type_capture) {
iid = MA_IID_DEVINTERFACE_AUDIO_CAPTURE; iid = MA_IID_DEVINTERFACE_AUDIO_CAPTURE;
} else { } else {
iid = MA_IID_DEVINTERFACE_AUDIO_RENDER; iid = MA_IID_DEVINTERFACE_AUDIO_RENDER;
} }
}
#if defined(__cplusplus) #if defined(__cplusplus)
hr = StringFromIID(iid, &iidStr); hr = StringFromIID(iid, &iidStr);
#else #else
hr = StringFromIID(&iid, &iidStr); hr = StringFromIID(&iid, &iidStr);
#endif #endif
if (FAILED(hr)) { if (FAILED(hr)) {
ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to convert device IID to string for ActivateAudioInterfaceAsync(). Out of memory.\n"); ma_log_postf(ma_context_get_log(pContext), MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to convert device IID to string for ActivateAudioInterfaceAsync(). Out of memory.\n");
return ma_result_from_HRESULT(hr); return ma_result_from_HRESULT(hr);
} }
}
result = ma_completion_handler_uwp_init(&completionHandler); result = ma_completion_handler_uwp_init(&completionHandler);
if (result != MA_SUCCESS) { if (result != MA_SUCCESS) {
...@@ -20850,7 +20850,9 @@ static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, m ...@@ -20850,7 +20850,9 @@ static ma_result ma_context_get_IAudioClient_UWP__wasapi(ma_context* pContext, m
return ma_result_from_HRESULT(hr); return ma_result_from_HRESULT(hr);
} }
if (pDeviceID == NULL) {
ma_CoTaskMemFree(pContext, iidStr); ma_CoTaskMemFree(pContext, iidStr);
}
/* Wait for the async operation for finish. */ /* Wait for the async operation for finish. */
ma_completion_handler_uwp_wait(&completionHandler); ma_completion_handler_uwp_wait(&completionHandler);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment