diff options
author | Chris Robinson <[email protected]> | 2016-12-01 18:11:52 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2016-12-01 18:11:52 -0800 |
commit | 338e0d72b447e5d8825b05e19790c997a3eaa8fd (patch) | |
tree | 1a7b8425004c6eca9e60c1ff1a15ccd60d84e550 /Alc/backends/oss.c | |
parent | 02a6031d03870847aa6b11628b80585004b45194 (diff) |
Ensure OSS devices are enumerated when a name is requested.
Diffstat (limited to 'Alc/backends/oss.c')
-rw-r--r-- | Alc/backends/oss.c | 14 |
1 files 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) |