diff options
author | Chris Robinson <[email protected]> | 2010-08-04 05:07:56 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2010-08-04 05:07:56 -0700 |
commit | aea615edb3c78323c0c53dad5ea5514436a48b75 (patch) | |
tree | 4da84e04694a15ac34faf06ec15e0f46b88faf1e /Alc/pulseaudio.c | |
parent | f6b2dfd09f41c239cccac946ff199a7c5d1128af (diff) |
Prevent re-probing while opening a Pulse device if no devices were found
Diffstat (limited to 'Alc/pulseaudio.c')
-rw-r--r-- | Alc/pulseaudio.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index 8401b715..e647ac5c 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -666,6 +666,11 @@ static void probe_devices(ALboolean capture) { pa_threaded_mainloop *loop; + if(capture == AL_FALSE) + allDevNameMap = malloc(sizeof(DevMap) * 1); + else + allCaptureDevNameMap = malloc(sizeof(DevMap) * 1); + if((loop=ppa_threaded_mainloop_new()) && ppa_threaded_mainloop_start(loop) >= 0) { @@ -679,7 +684,6 @@ static void probe_devices(ALboolean capture) if(capture == AL_FALSE) { - allDevNameMap = malloc(sizeof(DevMap) * 1); allDevNameMap[0].name = strdup(pulse_device); allDevNameMap[0].device_name = NULL; numDevNames = 1; @@ -688,7 +692,6 @@ static void probe_devices(ALboolean capture) } else { - allCaptureDevNameMap = malloc(sizeof(DevMap) * 1); allCaptureDevNameMap[0].name = strdup(pulse_device); allCaptureDevNameMap[0].device_name = NULL; numCaptureDevNames = 1; |