From 75261165afb5de2bed11947ffdd7dacfd3705e38 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 31 Oct 2013 18:14:10 +0100 Subject: ao_pulse: fix channel layouts The code was selecting PA_CHANNEL_POSITION_MONO for MP_SPEAKER_ID_FC, which is correct only with the "mono" channel layout, but not anything else. Remove the mono entry, and handle mono separately. See github issue #326. --- audio/out/ao_pulse.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c index 89dac4d2cc..9d86cddd6d 100644 --- a/audio/out/ao_pulse.c +++ b/audio/out/ao_pulse.c @@ -147,7 +147,6 @@ static const struct format_map { }; static const int speaker_map[][2] = { - {PA_CHANNEL_POSITION_MONO, MP_SPEAKER_ID_FC}, {PA_CHANNEL_POSITION_FRONT_LEFT, MP_SPEAKER_ID_FL}, {PA_CHANNEL_POSITION_FRONT_RIGHT, MP_SPEAKER_ID_FR}, {PA_CHANNEL_POSITION_FRONT_CENTER, MP_SPEAKER_ID_FC}, @@ -174,6 +173,10 @@ static bool chmap_pa_from_mp(pa_channel_map *dst, struct mp_chmap *src) if (src->num > PA_CHANNELS_MAX) return false; dst->channels = src->num; + if (mp_chmap_equals(src, &(const struct mp_chmap)MP_CHMAP_INIT_MONO)) { + dst->map[0] = PA_CHANNEL_POSITION_MONO; + return true; + } for (int n = 0; n < src->num; n++) { int mp_speaker = src->speaker[n]; int pa_speaker = PA_CHANNEL_POSITION_INVALID; -- cgit v1.2.3