summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-10-31 18:14:10 +0100
committerwm4 <wm4@nowhere>2013-11-02 19:06:13 +0100
commitee54711cebffd7e8c6f54b019f2fef14d3214ac8 (patch)
tree84e111f8310f341f1d1aab9b5c8514c4636c0a04
parent3ac568714c385ddc6e2a87bbd74f3ac7faad6d68 (diff)
downloadmpv-ee54711cebffd7e8c6f54b019f2fef14d3214ac8.tar.bz2
mpv-ee54711cebffd7e8c6f54b019f2fef14d3214ac8.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.
-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 a86871142f..6f725f2e10 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;