|author||wm4 <wm4@nowhere>||2013-03-23 17:49:52 +0100|
|committer||wm4 <wm4@nowhere>||2013-04-13 04:21:28 +0200|
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/reorder_ch.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/reorder_ch.h b/audio/reorder_ch.h
index 07daa35a08..a63fb0a959 100644
@@ -113,7 +113,7 @@ void reorder_channel(void *buf,
#define AF_CHANNEL_LAYOUT_LAVC_DEFAULT 3
#define AF_CHANNEL_LAYOUT_VORBIS_DEFAULT 4
#define AF_CHANNEL_LAYOUT_SOURCE_NUM 5
-#define AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT AF_CHANNEL_LAYOUT_ALSA_DEFAULT
+#define AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT AF_CHANNEL_LAYOUT_LAVC_DEFAULT
/// Optimized channel reorder between different audio sources and targets.
void reorder_channel_copy_nch(void *src,