From cbbda9329297c6e2feedbf03b6ad853501ae4e96 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 26 Dec 2009 09:17:03 -0800 Subject: Make sure a proper channel map is set for pulse capture --- Alc/pulseaudio.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'Alc') diff --git a/Alc/pulseaudio.c b/Alc/pulseaudio.c index e4f53f4c..e8c21b2b 100644 --- a/Alc/pulseaudio.c +++ b/Alc/pulseaudio.c @@ -655,6 +655,7 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na { pulse_data *data; pa_stream_state_t state; + pa_channel_map chanmap; if(!device_name) device_name = pulse_capture_device; @@ -724,7 +725,16 @@ static ALCboolean pulse_open_capture(ALCdevice *device, const ALCchar *device_na return ALC_FALSE; } - data->stream = ppa_stream_new(data->context, data->stream_name, &data->spec, NULL); + if(!ppa_channel_map_init_auto(&chanmap, data->spec.channels, PA_CHANNEL_MAP_WAVEEX)) + { + AL_PRINT("Couldn't build map for channel count (%d)!\n", data->spec.channels); + ppa_threaded_mainloop_unlock(data->loop); + pulse_close(device); + pulse_unload(); + return ALC_FALSE; + } + + data->stream = ppa_stream_new(data->context, data->stream_name, &data->spec, &chanmap); if(!data->stream) { AL_PRINT("pa_stream_new() failed: %s\n", -- cgit v1.2.3