aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
Diffstat (limited to 'Alc')
-rw-r--r--Alc/ALc.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 554a4951..00c6b6fa 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -1075,27 +1075,33 @@ static void alc_initconfig(void)
BackendListSize = i;
}
- for(i = 0;i < BackendListSize && (!PlaybackBackend.name || !CaptureBackend.name);i++)
+ for(n = i = 0;i < BackendListSize && (!PlaybackBackend.name || !CaptureBackend.name);i++)
{
- ALCbackendFactory *factory = BackendList[i].getFactory();
+ ALCbackendFactory *factory;
+ BackendList[n] = BackendList[i];
+
+ factory = BackendList[n].getFactory();
if(!V0(factory,init)())
{
- WARN("Failed to initialize backend \"%s\"\n", BackendList[i].name);
+ WARN("Failed to initialize backend \"%s\"\n", BackendList[n].name);
continue;
}
- TRACE("Initialized backend \"%s\"\n", BackendList[i].name);
+ TRACE("Initialized backend \"%s\"\n", BackendList[n].name);
if(!PlaybackBackend.name && V(factory,querySupport)(ALCbackend_Playback))
{
- PlaybackBackend = BackendList[i];
+ PlaybackBackend = BackendList[n];
TRACE("Added \"%s\" for playback\n", PlaybackBackend.name);
}
if(!CaptureBackend.name && V(factory,querySupport)(ALCbackend_Capture))
{
- CaptureBackend = BackendList[i];
+ CaptureBackend = BackendList[n];
TRACE("Added \"%s\" for capture\n", CaptureBackend.name);
}
+ n++;
}
+ BackendListSize = n;
+
{
ALCbackendFactory *factory = ALCloopbackFactory_getFactory();
V0(factory,init)();