aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2017-07-05 12:23:08 -0700
committerChris Robinson <[email protected]>2017-07-05 12:23:08 -0700
commitdadf7a4cf2bb008fc9e20251f6e8895c0f5bf0d4 (patch)
treebfee6f57cce30857e222af2d5d4adaed9f23dc53
parent3af2ff7b2582a5060215dcefbc70084650d2856f (diff)
Try all drivers for an unknown device name
-rw-r--r--router/alc.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/router/alc.c b/router/alc.c
index 9f94c869..e8346ef1 100644
--- a/router/alc.c
+++ b/router/alc.c
@@ -374,12 +374,13 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename)
idx = GetDriverIndexForName(&AllDevicesList, devicename);
}
almtx_unlock(&EnumerationLock);
- if(idx < 0)
+ if(idx >= 0)
+ device = DriverList[idx].alcOpenDevice(devicename);
+ else for(idx = 0;idx < DriverListSize;idx++)
{
- ATOMIC_STORE_SEQ(&LastError, ALC_INVALID_VALUE);
- return NULL;
+ device = DriverList[idx].alcOpenDevice(devicename);
+ if(device) break;
}
- device = DriverList[idx].alcOpenDevice(devicename);
}
else
{
@@ -815,14 +816,17 @@ ALC_API ALCdevice* ALC_APIENTRY alcCaptureOpenDevice(const ALCchar *devicename,
(void)alcGetString(NULL, ALC_CAPTURE_DEVICE_SPECIFIER);
idx = GetDriverIndexForName(&CaptureDevicesList, devicename);
almtx_unlock(&EnumerationLock);
- if(idx < 0)
+ if(idx >= 0)
+ device = DriverList[idx].alcCaptureOpenDevice(
+ devicename, frequency, format, buffersize
+ );
+ else for(idx = 0;idx < DriverListSize;idx++)
{
- ATOMIC_STORE_SEQ(&LastError, ALC_INVALID_VALUE);
- return NULL;
+ device = DriverList[idx].alcCaptureOpenDevice(
+ devicename, frequency, format, buffersize
+ );
+ if(device) break;
}
- device = DriverList[idx].alcCaptureOpenDevice(
- devicename, frequency, format, buffersize
- );
}
else
{