1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-24 15:52:25 +00:00

audio: fix ALSA 4 channel surround output

It turns out that ALSA's 4 channel layout is different from mpv's and
ffmpeg's 4.0 layout. Thus trying to do 4 channel output led to incorrect
remixing via lib{av,sw}resample.

Fix the default layouts for the internal filter chain as well, although
I'm not sure if it matters at all.
This commit is contained in:
wm4 2013-05-13 18:17:27 +02:00
parent 636e1edd9e
commit a39d369c25
2 changed files with 4 additions and 2 deletions

View File

@ -102,10 +102,12 @@ static const struct mp_chmap default_layouts[MP_NUM_CHANNELS + 1] = {
// The channel order was lavc/waveex, but differs from lavc for 5, 6 and 8
// channels. 3 and 7 channels were likely undefined (no ALSA support).
// I'm not sure about the 4 channel case: ALSA uses "quad", while the ffmpeg
// default layout is "4.0".
static const char *mplayer_layouts[MP_NUM_CHANNELS + 1] = {
[1] = "mono",
[2] = "stereo",
[4] = "4.0",
[4] = "quad",
[5] = "5.0(alsa)",
[6] = "5.1(alsa)",
[8] = "7.1(alsa)",

View File

@ -325,7 +325,7 @@ static const char *device_channel_layouts[][2] = {
{"rear", "bl-br"},
{"center_lfe", "fc-lfe"},
{"side", "sl-sr"},
{"surround40", "fl-fr-fc-bc"},
{"surround40", "fl-fr-bl-br"},
{"surround50", "fl-fr-bl-br-fc"},
{"surround41", "fl-fr-bl-br-lfe"},
{"surround51", "fl-fr-bl-br-fc-lfe"},