From 338e0d72b447e5d8825b05e19790c997a3eaa8fd Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 1 Dec 2016 18:11:52 -0800 Subject: Ensure OSS devices are enumerated when a name is requested. --- Alc/backends/oss.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c index 432c75f2..2dca9232 100644 --- a/Alc/backends/oss.c +++ b/Alc/backends/oss.c @@ -320,10 +320,15 @@ static ALCenum ALCplaybackOSS_open(ALCplaybackOSS *self, const ALCchar *name) struct oss_device *dev = &oss_playback; ALCdevice *device = STATIC_CAST(ALCbackend, self)->mDevice; - if(!name) + if(!name || strcmp(name, dev->handle) == 0) name = dev->handle; else { + if(!dev->next) + { + ALCossListPopulate(&oss_playback, NULL); + dev = &oss_playback; + } while (dev != NULL) { if (strcmp(dev->handle, name) == 0) @@ -574,10 +579,15 @@ static ALCenum ALCcaptureOSS_open(ALCcaptureOSS *self, const ALCchar *name) int ossSpeed; char *err; - if(!name) + if(!name || strcmp(name, dev->handle) == 0) name = dev->handle; else { + if(!dev->next) + { + ALCossListPopulate(NULL, &oss_capture); + dev = &oss_capture; + } while (dev != NULL) { if (strcmp(dev->handle, name) == 0) -- cgit v1.2.3