Allow querying ALC_ALL_DEVICES_SPECIFIER from loopback devices

They only return the default/driver name, since loopback devices don't have a
canonical name.
This commit is contained in:
Chris Robinson 2021-06-22 03:25:31 -07:00
parent 8f3148ba53
commit d28cf80b6f

View File

@ -2267,8 +2267,10 @@ START_API_FUNC
case ALC_ALL_DEVICES_SPECIFIER:
if(DeviceRef dev{VerifyDevice(Device)})
{
if(dev->Type != DeviceType::Playback)
if(dev->Type == DeviceType::Capture)
alcSetError(dev.get(), ALC_INVALID_ENUM);
else if(dev->Type == DeviceType::Loopback)
value = alcDefaultName;
else
{
std::lock_guard<std::mutex> _{dev->StateLock};