summaryrefslogtreecommitdiffstats
path: root/audio/out
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-03-23 17:49:52 +0100
committerwm4 <wm4@nowhere>2013-04-13 04:21:28 +0200
commit41aefce730efd7da6068b7f61697c65759cd3f84 (patch)
tree30d045f278ba768952277e0da09386a023b91907 /audio/out
parentf54909d4df1e1f00481e3ca4aae02f9bf7b78668 (diff)
downloadmpv-41aefce730efd7da6068b7f61697c65759cd3f84.tar.bz2
mpv-41aefce730efd7da6068b7f61697c65759cd3f84.tar.xz
audio: switch to libavcodec channel order, use libavresample for mixing
Switch the internal channel order to libavcodec's. If the channel number mismatches at some point, use libavresample for up- or downmixing. Remove the old af_pan automatic downmixing. The libavcodec channel order should be equivalent to WAVEFORMATEX order, at least nowadays. reorder_ch.h assumes that WAVEFORMATEX and libavcodec might be different, but all defined channels have the same mappings. Remove the downmixing with af_pan as well as the channel conversion with af_channels from af.c, and prefer af_lavrresample for this. The automatic downmixing behavior should be the same as before (if the --channels option is set to 2, which is the default, the audio output is forced to 2 channels, and libavresample does all downmixing). Note that mpv still can't do channel layouts. It will pick the default channel layout according to the channel count. This will be fixed later by passing down the channel layout as well. af_hrtf depends on the order of the input channels, so reorder to ALSA (for which this code was written). This is better than changing the filter code, which is more risky. ao_pulse can accept waveext order directly, so set that as channel mapping.
Diffstat (limited to 'audio/out')
-rw-r--r--audio/out/ao_pulse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/out/ao_pulse.c b/audio/out/ao_pulse.c
index 314ef778bd..bb5af6f851 100644
--- a/audio/out/ao_pulse.c
+++ b/audio/out/ao_pulse.c
@@ -230,7 +230,7 @@ static int init(struct ao *ao, char *params)
goto fail;
}
- pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_ALSA);
+ pa_channel_map_init_auto(&map, ss.channels, PA_CHANNEL_MAP_WAVEEX);
ao->bps = pa_bytes_per_second(&ss);
if (!(priv->mainloop = pa_threaded_mainloop_new())) {