aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2011-08-19 01:54:55 -0700
committerChris Robinson <[email protected]>2011-08-19 01:54:55 -0700
commit3d722b9ba07d0c2bb34b73dd46183f2ef4eba8ce (patch)
treebad3a1625c511490aee04146b0585132d608fe7a
parent4ac0a507e0d9d43efb24d26d2ee01d0f3b003dfa (diff)
Don't remove backends that fail to initialize
-rw-r--r--Alc/ALc.c40
1 files changed, 14 insertions, 26 deletions
diff --git a/Alc/ALc.c b/Alc/ALc.c
index 372780a8..6916f970 100644
--- a/Alc/ALc.c
+++ b/Alc/ALc.c
@@ -647,38 +647,26 @@ static void alc_initconfig(void)
}
}
- i = 0;
- while(BackendList[i].Init && (!PlaybackBackend.name || !CaptureBackend.name))
+ for(i = 0;BackendList[i].Init && (!PlaybackBackend.name || !CaptureBackend.name);i++)
{
- if(BackendList[i].Init(&BackendList[i].Funcs))
+ if(!BackendList[i].Init(&BackendList[i].Funcs))
{
- TRACE("Initialized backend \"%s\"\n", BackendList[i].name);
- if(BackendList[i].Funcs.OpenPlayback && !PlaybackBackend.name)
- {
- PlaybackBackend = BackendList[i];
- TRACE("Added \"%s\" for playback\n", PlaybackBackend.name);
- }
- if(BackendList[i].Funcs.OpenCapture && !CaptureBackend.name)
- {
- CaptureBackend = BackendList[i];
- TRACE("Added \"%s\" for capture\n", CaptureBackend.name);
- }
- i++;
+ WARN("Failed to initialize backend \"%s\"\n", BackendList[i].name);
+ continue;
}
- else
+
+ TRACE("Initialized backend \"%s\"\n", BackendList[i].name);
+ if(BackendList[i].Funcs.OpenPlayback && !PlaybackBackend.name)
{
- TRACE("Failed to initialize backend \"%s\"\n", BackendList[i].name);
- n = i;
- do {
- BackendList[n] = BackendList[n+1];
- ++n;
- } while(BackendList[n].Init);
+ PlaybackBackend = BackendList[i];
+ TRACE("Added \"%s\" for playback\n", PlaybackBackend.name);
+ }
+ if(BackendList[i].Funcs.OpenCapture && !CaptureBackend.name)
+ {
+ CaptureBackend = BackendList[i];
+ TRACE("Added \"%s\" for capture\n", CaptureBackend.name);
}
}
- BackendList[i].name = NULL;
- BackendList[i].Init = NULL;
- BackendList[i].Deinit = NULL;
- BackendList[i].Probe = NULL;
BackendLoopback.Init(&BackendLoopback.Funcs);
str = GetConfigValue(NULL, "excludefx", "");