From 6e113eea89174c115001d2d294c9c638afdf7c8a Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Thu, 1 Mar 2012 01:34:49 -0800 Subject: [PATCH] Don't force a sample spec when looking for the default device --- Alc/backends/pulseaudio.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Alc/backends/pulseaudio.c b/Alc/backends/pulseaudio.c index 99c9fd18..06944eb2 100644 --- a/Alc/backends/pulseaudio.c +++ b/Alc/backends/pulseaudio.c @@ -751,15 +751,19 @@ static void probe_devices(ALboolean capture) if(capture == AL_FALSE) { + pa_stream_flags_t flags; pa_sample_spec spec; pa_stream *stream; + flags = PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | + PA_STREAM_FIX_CHANNELS; + spec.format = PA_SAMPLE_S16NE; spec.rate = 44100; spec.channels = 2; - stream = connect_playback_stream(NULL, loop, context, 0, NULL, - &spec, NULL); + stream = connect_playback_stream(NULL, loop, context, flags, + NULL, &spec, NULL); if(stream) { o = pa_context_get_sink_info_by_name(context, pa_stream_get_device_name(stream), sink_device_callback, loop); @@ -776,15 +780,19 @@ static void probe_devices(ALboolean capture) } else { + pa_stream_flags_t flags; pa_sample_spec spec; pa_stream *stream; + flags = PA_STREAM_FIX_FORMAT | PA_STREAM_FIX_RATE | + PA_STREAM_FIX_CHANNELS; + spec.format = PA_SAMPLE_S16NE; spec.rate = 44100; spec.channels = 1; - stream = connect_record_stream(NULL, loop, context, 0, NULL, - &spec, NULL); + stream = connect_record_stream(NULL, loop, context, flags, + NULL, &spec, NULL); if(stream) { o = pa_context_get_source_info_by_name(context, pa_stream_get_device_name(stream), source_device_callback, loop); -- 2.11.4.GIT