From b37e54eeadfdb55f464dcd3ec278df74f4910114 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Wed, 29 Feb 2012 23:35:01 -0800 Subject: [PATCH] Look for and enumerate the default PulseAudio sink first --- Alc/backends/pulseaudio.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index a4be58e2..6b00ddfa 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -707,7 +707,30 @@ static void probe_devices(ALboolean capture) pa_operation *o; if(capture == AL_FALSE) + { + pa_sample_spec spec; + pa_stream *stream; + + spec.format = PA_SAMPLE_S16NE; + spec.rate = 44100; + spec.channels = 2; + + stream = connect_playback_stream(NULL, loop, context, 0, NULL, + &spec, NULL); + if(stream) + { + o = pa_context_get_sink_info_by_name(context, pa_stream_get_device_name(stream), sink_device_callback, loop); + while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) + pa_threaded_mainloop_wait(loop); + pa_operation_unref(o); + + pa_stream_disconnect(stream); + pa_stream_unref(stream); + stream = NULL; + } + o = pa_context_get_sink_info_list(context, sink_device_callback, loop); + } else o = pa_context_get_source_info_list(context, source_device_callback, loop); while(pa_operation_get_state(o) == PA_OPERATION_RUNNING) -- 2.11.4.GIT