summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-31 18:14:10 +0100
committerwm4 <wm4@nowhere>2013-10-31 18:17:14 +0100
commit75261165afb5de2bed11947ffdd7dacfd3705e38 (patch)
treee775ad44d0ae636e662a848651c1f88a435b5009 /audio
parent7100a1012760388f501c886d9209831183552061 (diff)
downloadmpv-75261165afb5de2bed11947ffdd7dacfd3705e38.tar.bz2
mpv-75261165afb5de2bed11947ffdd7dacfd3705e38.tar.xz
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.
Diffstat (limited to 'audio')
-rw-r--r--audio/out/ao_pulse.c5
1 files changed, 4 insertions, 1 deletions
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;