Commit 8f7f8d62 authored by David Reid's avatar David Reid

WASAPI: Add support for disabling automatic stream routing.

This may be changed to a general config property later.

Related to public issue #119
parent 6b331cf9
...@@ -2013,6 +2013,7 @@ typedef struct ...@@ -2013,6 +2013,7 @@ typedef struct
{ {
ma_bool32 noAutoConvertSRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */ ma_bool32 noAutoConvertSRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_AUTOCONVERTPCM. */
ma_bool32 noDefaultQualitySRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */ ma_bool32 noDefaultQualitySRC; /* When set to true, disables the use of AUDCLNT_STREAMFLAGS_SRC_DEFAULT_QUALITY. */
ma_bool32 noAutoStreamRouting; /* Disables automatic stream routing. */
} wasapi; } wasapi;
struct struct
{ {
...@@ -9111,7 +9112,7 @@ ma_result ma_device_init__wasapi(ma_context* pContext, const ma_device_config* p ...@@ -9111,7 +9112,7 @@ ma_result ma_device_init__wasapi(ma_context* pContext, const ma_device_config* p
registering a IMMNotificationClient with it. We only care about this if it's the default device. registering a IMMNotificationClient with it. We only care about this if it's the default device.
*/ */
#ifdef MA_WIN32_DESKTOP #ifdef MA_WIN32_DESKTOP
{ if (pConfig->wasapi.noAutoStreamRouting == MA_FALSE) {
ma_IMMDeviceEnumerator* pDeviceEnumerator; ma_IMMDeviceEnumerator* pDeviceEnumerator;
HRESULT hr = ma_CoCreateInstance(pContext, MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator); HRESULT hr = ma_CoCreateInstance(pContext, MA_CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, MA_IID_IMMDeviceEnumerator, (void**)&pDeviceEnumerator);
if (FAILED(hr)) { if (FAILED(hr)) {
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