aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-06-29 08:35:21 -0700
committerChris Robinson <[email protected]>2017-06-29 08:35:21 -0700
commit15e6821147746fcdd1e7d38e830677641669ff5d (patch)
treebf26fea98ce0b41220b18e23ba871dd19127c228
parent3a16fed279b69dbb74ca26f11279cbf258643ff2 (diff)
Avoid unnecessary reenumeration in the router
-rw-r--r--router/alc.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/router/alc.c b/router/alc.c
index 35912936..b15283fb 100644
--- a/router/alc.c
+++ b/router/alc.c
@@ -334,6 +334,10 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename)
ALCdevice *device;
ALint idx = 0;
+ /* Prior to the enumeration extension, apps would hardcode these names as a
+ * quality hint for the wrapper driver. Ignore them since there's no sane
+ * way to map them.
+ */
if(devicename && (devicename[0] == '\0' ||
strcmp(devicename, "DirectSound3D") == 0 ||
strcmp(devicename, "DirectSound") == 0 ||
@@ -341,11 +345,13 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename)
devicename = NULL;
if(devicename)
{
- (void)alcGetString(NULL, ALC_DEVICE_SPECIFIER);
+ if(!DevicesList.Names)
+ (void)alcGetString(NULL, ALC_DEVICE_SPECIFIER);
idx = GetDriverIndexForName(&DevicesList, devicename);
if(idx < 0)
{
- (void)alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
+ if(!AllDevicesList.Names)
+ (void)alcGetString(NULL, ALC_ALL_DEVICES_SPECIFIER);
idx = GetDriverIndexForName(&AllDevicesList, devicename);
if(idx < 0)
{
@@ -739,7 +745,8 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename,
devicename = NULL;
if(devicename)
{
- (void)alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
+ if(!CaptureDevicesList.Names)
+ (void)alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
idx = GetDriverIndexForName(&CaptureDevicesList, devicename);
if(idx < 0)
{