aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/oss.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2016-12-01 18:26:18 -0800
committerChris Robinson <[email protected]>2016-12-01 18:26:18 -0800
commit66569295e5ac27dcddb4f20d25a30801af7ca992 (patch)
treec50306a37e20dbe17833b0d37bfdd4a7eaa5711b /Alc/backends/oss.c
parent338e0d72b447e5d8825b05e19790c997a3eaa8fd (diff)
Minor cleanup for ALCossListPopulate
Diffstat (limited to 'Alc/backends/oss.c')
-rw-r--r--Alc/backends/oss.c40
1 files changed, 18 insertions, 22 deletions
diff --git a/Alc/backends/oss.c b/Alc/backends/oss.c
index 2dca9232..41f2c39f 100644
--- a/Alc/backends/oss.c
+++ b/Alc/backends/oss.c
@@ -88,7 +88,7 @@ static struct oss_device oss_capture = {
#ifdef ALC_OSS_COMPAT
-static void ALCossListPopulate(struct oss_device *UNUSED(playback), struct oss_device *UNUSED(capture))
+static void ALCossListPopulate(struct oss_device *UNUSED(devlist), int UNUSED(type_flag))
{
}
@@ -153,7 +153,7 @@ static void ALCossListAppend(struct oss_device *list, const char *handle, size_t
TRACE("Got device \"%s\", \"%s\"\n", next->handle, next->path);
}
-static void ALCossListPopulate(struct oss_device *playback, struct oss_device *capture)
+static void ALCossListPopulate(struct oss_device *devlist, int type_flag)
{
struct oss_sysinfo si;
struct oss_audioinfo ai;
@@ -193,10 +193,9 @@ static void ALCossListPopulate(struct oss_device *playback, struct oss_device *c
len = strnlen(ai.name, sizeof(ai.name));
handle = ai.name;
}
- if((ai.caps&DSP_CAP_INPUT) && capture != NULL)
- ALCossListAppend(capture, handle, len, ai.devnode, strnlen(ai.devnode, sizeof(ai.devnode)));
- if((ai.caps&DSP_CAP_OUTPUT) && playback != NULL)
- ALCossListAppend(playback, handle, len, ai.devnode, strnlen(ai.devnode, sizeof(ai.devnode)));
+ if((ai.caps&type_flag))
+ ALCossListAppend(devlist, handle, len, ai.devnode,
+ strnlen(ai.devnode, sizeof(ai.devnode)));
}
done:
@@ -326,7 +325,7 @@ static ALCenum ALCplaybackOSS_open(ALCplaybackOSS *self, const ALCchar *name)
{
if(!dev->next)
{
- ALCossListPopulate(&oss_playback, NULL);
+ ALCossListPopulate(&oss_playback, DSP_CAP_OUTPUT);
dev = &oss_playback;
}
while (dev != NULL)
@@ -585,7 +584,7 @@ static ALCenum ALCcaptureOSS_open(ALCcaptureOSS *self, const ALCchar *name)
{
if(!dev->next)
{
- ALCossListPopulate(NULL, &oss_capture);
+ ALCossListPopulate(&oss_capture, DSP_CAP_INPUT);
dev = &oss_capture;
}
while (dev != NULL)
@@ -780,33 +779,30 @@ ALCboolean ALCossBackendFactory_querySupport(ALCossBackendFactory* UNUSED(self),
void ALCossBackendFactory_probe(ALCossBackendFactory* UNUSED(self), enum DevProbe type)
{
+ struct oss_device *cur;
switch(type)
{
case ALL_DEVICE_PROBE:
- {
- struct oss_device *cur = &oss_playback;
- ALCossListFree(cur);
- ALCossListPopulate(cur, NULL);
- while (cur != NULL)
+ ALCossListFree(&oss_playback);
+ ALCossListPopulate(&oss_playback, DSP_CAP_OUTPUT);
+ cur = &oss_playback;
+ while(cur != NULL)
{
AppendAllDevicesList(cur->handle);
cur = cur->next;
}
- }
- break;
+ break;
case CAPTURE_DEVICE_PROBE:
- {
- struct oss_device *cur = &oss_capture;
- ALCossListFree(cur);
- ALCossListPopulate(NULL, cur);
- while (cur != NULL)
+ ALCossListFree(&oss_capture);
+ ALCossListPopulate(&oss_capture, DSP_CAP_INPUT);
+ cur = &oss_capture;
+ while(cur != NULL)
{
AppendCaptureDeviceList(cur->handle);
cur = cur->next;
}
- }
- break;
+ break;
}
}