mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 08:14:04 +02:00
Clean up some code from an earlier commit.
This commit is contained in:
+4
-4
@@ -13405,6 +13405,9 @@ static ma_result ma_device_init__wasapi(ma_context* pContext, const ma_device_co
|
|||||||
*/
|
*/
|
||||||
#ifdef MA_WIN32_DESKTOP
|
#ifdef MA_WIN32_DESKTOP
|
||||||
if (pConfig->wasapi.noAutoStreamRouting == MA_FALSE) {
|
if (pConfig->wasapi.noAutoStreamRouting == MA_FALSE) {
|
||||||
|
ma_IMMDeviceEnumerator* pDeviceEnumerator;
|
||||||
|
HRESULT hr;
|
||||||
|
|
||||||
if ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pConfig->capture.pDeviceID == NULL) {
|
if ((pConfig->deviceType == ma_device_type_capture || pConfig->deviceType == ma_device_type_duplex) && pConfig->capture.pDeviceID == NULL) {
|
||||||
pDevice->wasapi.allowCaptureAutoStreamRouting = MA_TRUE;
|
pDevice->wasapi.allowCaptureAutoStreamRouting = MA_TRUE;
|
||||||
}
|
}
|
||||||
@@ -13412,9 +13415,7 @@ static ma_result ma_device_init__wasapi(ma_context* pContext, const ma_device_co
|
|||||||
pDevice->wasapi.allowPlaybackAutoStreamRouting = MA_TRUE;
|
pDevice->wasapi.allowPlaybackAutoStreamRouting = MA_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if (pDevice->wasapi.allowCaptureAutoStreamRouting || pDevice->wasapi.allowPlaybackAutoStreamRouting) {
|
hr = ma_CoCreateInstance(pContext, MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator);
|
||||||
ma_IMMDeviceEnumerator* pDeviceEnumerator;
|
|
||||||
HRESULT hr = ma_CoCreateInstance(pContext, MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator);
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
ma_device_uninit__wasapi(pDevice);
|
ma_device_uninit__wasapi(pDevice);
|
||||||
return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create device enumerator.", ma_result_from_HRESULT(hr));
|
return ma_post_error(pDevice, MA_LOG_LEVEL_ERROR, "[WASAPI] Failed to create device enumerator.", ma_result_from_HRESULT(hr));
|
||||||
@@ -13431,7 +13432,6 @@ static ma_result ma_device_init__wasapi(ma_context* pContext, const ma_device_co
|
|||||||
/* Not the end of the world if we fail to register the notification callback. We just won't support automatic stream routing. */
|
/* Not the end of the world if we fail to register the notification callback. We just won't support automatic stream routing. */
|
||||||
ma_IMMDeviceEnumerator_Release(pDeviceEnumerator);
|
ma_IMMDeviceEnumerator_Release(pDeviceEnumerator);
|
||||||
}
|
}
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user