diff options
author | Chris Robinson <[email protected]> | 2009-09-23 01:33:58 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-09-23 01:33:58 -0700 |
commit | 201b108a543c8d0472341918ffac012ad1d94a69 (patch) | |
tree | 029e5f940ee83554720c92ef71ab667ab82998ed | |
parent | bdbdbcea26d4a12d4d3f76ad3724f2ad12a55358 (diff) |
Attempt to reload backend libs when probing, if they didn't initially load
-rw-r--r-- | Alc/alsa.c | 8 | ||||
-rw-r--r-- | Alc/dsound.c | 8 | ||||
-rw-r--r-- | Alc/portaudio.c | 6 | ||||
-rw-r--r-- | Alc/pulseaudio.c | 6 |
4 files changed, 14 insertions, 14 deletions
@@ -775,7 +775,7 @@ void alc_alsa_init(BackendFuncs *func_list) { char *str; - *func_list = alsa_funcs; + if(func_list) *func_list = alsa_funcs; #ifdef HAVE_DLFCN_H alsa_handle = dlopen("libasound.so.2", RTLD_NOW); @@ -877,8 +877,8 @@ void alc_alsa_deinit(void) #ifdef HAVE_DLFCN_H if(alsa_handle) dlclose(alsa_handle); - alsa_handle = NULL; #endif + alsa_handle = NULL; } void alc_alsa_probe(int type) @@ -891,8 +891,8 @@ void alc_alsa_probe(int type) char name[128]; ALuint i; - if(!alsa_handle) - return; + if(!alsa_handle) alc_alsa_init(NULL); + if(!alsa_handle) return; psnd_ctl_card_info_malloc(&info); psnd_pcm_info_malloc(&pcminfo); diff --git a/Alc/dsound.c b/Alc/dsound.c index ac172344..fe7a0b50 100644 --- a/Alc/dsound.c +++ b/Alc/dsound.c @@ -479,7 +479,7 @@ static BOOL CALLBACK DSoundEnumDevices(LPGUID guid, LPCSTR desc, LPCSTR drvname, void alcDSoundInit(BackendFuncs *FuncList) { - *FuncList = DSoundFuncs; + if(FuncList) *FuncList = DSoundFuncs; #ifdef _WIN32 ds_handle = LoadLibraryA("dsound.dll"); @@ -522,14 +522,14 @@ void alcDSoundDeinit(void) #ifdef _WIN32 if(ds_handle) FreeLibrary(ds_handle); - ds_handle = NULL; #endif + ds_handle = NULL; } void alcDSoundProbe(int type) { - if(!ds_handle) - return; + if(!ds_handle) alcDSoundInit(NULL); + if(!ds_handle) return; if(type == DEVICE_PROBE) AppendDeviceList(dsDevice); diff --git a/Alc/portaudio.c b/Alc/portaudio.c index fb4b8ed5..7ef255f2 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -199,7 +199,7 @@ void alc_pa_init(BackendFuncs *func_list) const char *str; PaError err; - *func_list = pa_funcs; + if(func_list) *func_list = pa_funcs; #ifdef HAVE_DLFCN_H #if defined(__APPLE__) && defined(__MACH__) @@ -261,8 +261,8 @@ void alc_pa_deinit(void) void alc_pa_probe(int type) { - if(!pa_handle) - return; + if(!pa_handle) alc_pa_init(NULL); + if(!pa_handle) return; if(type == DEVICE_PROBE) AppendDeviceList(pa_device); diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 85f0bcb2..8cc87606 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -631,7 +631,7 @@ BackendFuncs pulse_funcs = { //{{{ void alc_pulse_init(BackendFuncs *func_list) //{{{ { - *func_list = pulse_funcs; + if(func_list) *func_list = pulse_funcs; #ifdef _WIN32 pa_handle = LoadLibrary("libpulse-0.dll"); @@ -726,8 +726,8 @@ void alc_pulse_deinit(void) //{{{ void alc_pulse_probe(int type) //{{{ { - if(!pa_handle) - return; + if(!pa_handle) alc_pulse_init(NULL); + if(!pa_handle) return; if(type == DEVICE_PROBE) AppendDeviceList(pulse_device); |