diff options
author | Chris Robinson <[email protected]> | 2009-08-27 06:09:33 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2009-08-27 06:09:33 -0700 |
commit | bb121e68a618d1881a6e35c47938ce0650d07afb (patch) | |
tree | 620e024aa067cc96d36a91e2210beffc2115220e /Alc/portaudio.c | |
parent | 1ec26fd789ddfcbabbeae003f286cc01062721c0 (diff) |
Rebuild device lists when retrieving them
Diffstat (limited to 'Alc/portaudio.c')
-rw-r--r-- | Alc/portaudio.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/Alc/portaudio.c b/Alc/portaudio.c index 20bb2d7b..a8a8ceb5 100644 --- a/Alc/portaudio.c +++ b/Alc/portaudio.c @@ -244,17 +244,27 @@ void alc_pa_init(BackendFuncs *func_list) if((err=pPa_Initialize()) != paNoError) { AL_PRINT("Pa_Initialize() returned an error: %s\n", pPa_GetErrorText(err)); + alc_pa_deinit(); return; } - - AppendDeviceList(pa_device); - AppendAllDeviceList(pa_device); } void alc_pa_deinit(void) { #ifdef HAVE_DLFCN_H - dlclose(pa_handle); + if(pa_handle) + dlclose(pa_handle); pa_handle = NULL; #endif } + +void alc_pa_probe(int type) +{ + if(!pa_handle) + return; + + if(type == DEVICE_PROBE) + AppendDeviceList(pa_device); + else if(type == ALL_DEVICE_PROBE) + AppendAllDeviceList(pa_device); +} |