aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2009-12-26 09:17:03 -0800
committerChris Robinson <[email protected]>2009-12-26 09:17:03 -0800
commitcbbda9329297c6e2feedbf03b6ad853501ae4e96 (patch)
treeeb8164fa0f74d07c49ebadc9eb673afba35fcf66 /Alc
parentc6340ce12d64062fa0723b2d24cb567bb375b378 (diff)
Make sure a proper channel map is set for pulse capture
Diffstat (limited to 'Alc')
-rw-r--r--Alc/pulseaudio.c12
1 files changed, 11 insertions, 1 deletions
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",