aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/pulseaudio.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-02-29 23:35:01 -0800
committerChris Robinson <[email protected]>2012-02-29 23:35:01 -0800
commitb37e54eeadfdb55f464dcd3ec278df74f4910114 (patch)
tree4141dd59cda85426370d4c5190b37eeb16134bbe /Alc/backends/pulseaudio.c
parentea4f458c1db73c21db887c00cd0074d6d2b049a6 (diff)
Look for and enumerate the default PulseAudio sink first
Diffstat (limited to 'Alc/backends/pulseaudio.c')
-rw-r--r--Alc/backends/pulseaudio.c23
1 files changed, 23 insertions, 0 deletions
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)