aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-03-01 01:34:49 -0800
committerChris Robinson <[email protected]>2012-03-01 01:34:49 -0800
commit6e113eea89174c115001d2d294c9c638afdf7c8a (patch)
treeb5531fe0d96d7c5ec01c4f8968e13b71631300d8 /Alc/backends
parent54f906b347af48571bf1322053c06379ec30fe93 (diff)
Don't force a sample spec when looking for the default device
Diffstat (limited to 'Alc/backends')
-rw-r--r--Alc/backends/pulseaudio.c16
1 files 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);