From 80b8abb0ec69b8c742c38f35e94870e6a27b852b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 20 Aug 2011 03:00:38 -0700 Subject: Don't enumerate "PulseAudio Default" in the ALL_DEVICES list --- Alc/backends/pulseaudio.c | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 39df3282..787d6a58 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -757,21 +757,9 @@ static void probe_devices(ALboolean capture) pa_operation *o; if(capture == AL_FALSE) - { - allDevNameMap[0].name = strdup(pulse_device); - allDevNameMap[0].device_name = NULL; - numDevNames = 1; - o = pa_context_get_sink_info_list(context, sink_device_callback, loop); - } else - { - allCaptureDevNameMap[0].name = strdup(pulse_device); - allCaptureDevNameMap[0].device_name = NULL; - numCaptureDevNames = 1; - o = pa_context_get_source_info_list(context, source_device_callback, loop); - } while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) pa_threaded_mainloop_wait(loop); pa_operation_unref(o); @@ -869,9 +857,9 @@ static ALCboolean pulse_open_playback(ALCdevice *device, const ALCchar *device_n if(!allDevNameMap) probe_devices(AL_FALSE); - if(!device_name && numDevNames > 0) - device_name = allDevNameMap[0].name; - else + if(!device_name) + device_name = pulse_device; + else if(strcmp(device_name, pulse_device) != 0) { ALuint i; @@ -1108,9 +1096,9 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na if(!allCaptureDevNameMap) probe_devices(AL_TRUE); - if(!device_name && numCaptureDevNames > 0) - device_name = allCaptureDevNameMap[0].name; - else + if(!device_name) + device_name = pulse_device; + else if(strcmp(device_name, pulse_device) != 0) { ALuint i; -- cgit v1.2.3