aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/ALc.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/ALc.c')
-rw-r--r--Alc/ALc.c30
1 files changed, 9 insertions, 21 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 32fe4c5d..20aa4be0 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1223,39 +1223,27 @@ static void alc_deinit(void)
/************************************************
* Device enumeration
************************************************/
-static void ProbeDevices(al_string *list, enum DevProbe type)
+static void ProbeDevices(al_string *list, struct BackendInfo *backendinfo, enum DevProbe type)
{
DO_INITCONFIG();
LockLists();
al_string_clear(list);
- if(type == ALL_DEVICE_PROBE && (PlaybackBackend.Probe || PlaybackBackend.getFactory))
- {
- if(!PlaybackBackend.getFactory)
- PlaybackBackend.Probe(type);
- else
- {
- ALCbackendFactory *factory = PlaybackBackend.getFactory();
- V(factory,probe)(type);
- }
- }
- else if(type == CAPTURE_DEVICE_PROBE && (CaptureBackend.Probe || CaptureBackend.getFactory))
+ if(!backendinfo->getFactory)
+ backendinfo->Probe(type);
+ else
{
- if(!CaptureBackend.getFactory)
- CaptureBackend.Probe(type);
- else
- {
- ALCbackendFactory *factory = CaptureBackend.getFactory();
- V(factory,probe)(type);
- }
+ ALCbackendFactory *factory = backendinfo->getFactory();
+ V(factory,probe)(type);
}
+
UnlockLists();
}
static void ProbeAllDevicesList(void)
-{ ProbeDevices(&alcAllDevicesList, ALL_DEVICE_PROBE); }
+{ ProbeDevices(&alcAllDevicesList, &PlaybackBackend, ALL_DEVICE_PROBE); }
static void ProbeCaptureDeviceList(void)
-{ ProbeDevices(&alcCaptureDeviceList, CAPTURE_DEVICE_PROBE); }
+{ ProbeDevices(&alcCaptureDeviceList, &CaptureBackend, CAPTURE_DEVICE_PROBE); }
static void AppendDevice(const ALCchar *name, al_string *devnames)
{