diff options
author | Chris Robinson <[email protected]> | 2011-08-19 01:54:55 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2011-08-19 01:54:55 -0700 |
commit | 3d722b9ba07d0c2bb34b73dd46183f2ef4eba8ce (patch) | |
tree | bad3a1625c511490aee04146b0585132d608fe7a | |
parent | 4ac0a507e0d9d43efb24d26d2ee01d0f3b003dfa (diff) |
Don't remove backends that fail to initialize
-rw-r--r-- | Alc/ALc.c | 40 |
1 files changed, 14 insertions, 26 deletions
@@ -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", ""); |