summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-07-04 11:06:06 +0200
committerGitHub <noreply@github.com>2019-07-04 11:06:06 +0200
commitd6d487d7f70e558972c6750fc0f53a166dbd0fc8 (patch)
treee4a2c5384e1a5dcbdad11d42ed70f762238484a7
parent1ddb61025562fc1dfde2edcf4cd5542d11414566 (diff)
parent9fa2e07588eb91b72ee4e6abdb30458673c88498 (diff)
Merge pull request #30232 from zwostein/fix-pulseaudio-channelmap
Explicitly set a channel map when initialising the Pulseaudio stream.
-rw-r--r--drivers/pulseaudio/audio_driver_pulseaudio.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/pulseaudio/audio_driver_pulseaudio.cpp b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
index aec3d27d69..a61fa449f1 100644
--- a/drivers/pulseaudio/audio_driver_pulseaudio.cpp
+++ b/drivers/pulseaudio/audio_driver_pulseaudio.cpp
@@ -191,6 +191,14 @@ Error AudioDriverPulseAudio::init_device() {
spec.format = PA_SAMPLE_S16LE;
spec.channels = pa_map.channels;
spec.rate = mix_rate;
+ pa_map.map[0] = PA_CHANNEL_POSITION_FRONT_LEFT;
+ pa_map.map[1] = PA_CHANNEL_POSITION_FRONT_RIGHT;
+ pa_map.map[2] = PA_CHANNEL_POSITION_FRONT_CENTER;
+ pa_map.map[3] = PA_CHANNEL_POSITION_LFE;
+ pa_map.map[4] = PA_CHANNEL_POSITION_REAR_LEFT;
+ pa_map.map[5] = PA_CHANNEL_POSITION_REAR_RIGHT;
+ pa_map.map[6] = PA_CHANNEL_POSITION_SIDE_LEFT;
+ pa_map.map[7] = PA_CHANNEL_POSITION_SIDE_RIGHT;
pa_str = pa_stream_new(pa_ctx, "Sound", &spec, &pa_map);
if (pa_str == NULL) {