aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/oss.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/oss.c')
-rw-r--r--Alc/backends/oss.c14
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)