diff options
author | Chris Robinson <[email protected]> | 2017-07-05 14:18:16 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-07-05 14:18:16 -0700 |
commit | faefa1d55479a5d5a05ddb18f6b9051634adec3d (patch) | |
tree | c1bee7ab10f77e272978d46c22ee7f7fd5652714 /router/alc.c | |
parent | 56a33ef955e33609236527300188115a74ddf41c (diff) |
Revert "Try all drivers for an unknown device name"
This reverts commit dadf7a4cf2bb008fc9e20251f6e8895c0f5bf0d4.
Diffstat (limited to 'router/alc.c')
-rw-r--r-- | router/alc.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/router/alc.c b/router/alc.c index e8346ef1..9f94c869 100644 --- a/router/alc.c +++ b/router/alc.c @@ -374,13 +374,12 @@ ALC_API ALCdevice* ALC_APIENTRY alcOpenDevice(const ALCchar *devicename) idx = GetDriverIndexForName(&AllDevicesList, devicename); } almtx_unlock(&EnumerationLock); - if(idx >= 0) - device = DriverList[idx].alcOpenDevice(devicename); - else for(idx = 0;idx < DriverListSize;idx++) + if(idx < 0) { - device = DriverList[idx].alcOpenDevice(devicename); - if(device) break; + ATOMIC_STORE_SEQ(&LastError, ALC_INVALID_VALUE); + return NULL; } + device = DriverList[idx].alcOpenDevice(devicename); } else { @@ -816,17 +815,14 @@ 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) - device = DriverList[idx].alcCaptureOpenDevice( - devicename, frequency, format, buffersize - ); - else for(idx = 0;idx < DriverListSize;idx++) + if(idx < 0) { - device = DriverList[idx].alcCaptureOpenDevice( - devicename, frequency, format, buffersize - ); - if(device) break; + ATOMIC_STORE_SEQ(&LastError, ALC_INVALID_VALUE); + return NULL; } + device = DriverList[idx].alcCaptureOpenDevice( + devicename, frequency, format, buffersize + ); } else { |