diff options
author | tack <tack@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-10 00:45:19 +0000 |
---|---|---|
committer | tack <tack@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2009-11-10 00:45:19 +0000 |
commit | 3c2afd67861769e82034b2ca276d2670964fc09c (patch) | |
tree | 9fa61272171332b4352fb34bde7ced4999244444 /libao2 | |
parent | 1d30062395914bbc9eef1299c70018df9f333628 (diff) | |
download | mpv-3c2afd67861769e82034b2ca276d2670964fc09c.tar.bz2 mpv-3c2afd67861769e82034b2ca276d2670964fc09c.tar.xz |
Add support for 8 channel audio.
Where 8 channel support is non-trivial (e.g. ao_dsound), at least ensure we
fail gracefully.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29868 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libao2')
-rw-r--r-- | libao2/ao_alsa.c | 7 | ||||
-rw-r--r-- | libao2/ao_dsound.c | 7 | ||||
-rw-r--r-- | libao2/ao_pcm.c | 2 |
3 files changed, 14 insertions, 2 deletions
diff --git a/libao2/ao_alsa.c b/libao2/ao_alsa.c index 8d2a0510c7..7376c0f18d 100644 --- a/libao2/ao_alsa.c +++ b/libao2/ao_alsa.c @@ -457,6 +457,13 @@ static int init(int rate_hz, int channels, int format, int flags) device.str = "surround51"; mp_msg(MSGT_AO,MSGL_V,"alsa-init: device set to surround51\n"); break; + case 8: + if (alsa_format == SND_PCM_FORMAT_FLOAT_LE) + device.str = "plug:surround71"; + else + device.str = "surround71"; + mp_msg(MSGT_AO,MSGL_V,"alsa-init: device set to surround71\n"); + break; default: device.str = "default"; mp_msg(MSGT_AO,MSGL_ERR,MSGTR_AO_ALSA_ChannelsNotSupported,channels); diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c index fc069dad5e..f66042a793 100644 --- a/libao2/ao_dsound.c +++ b/libao2/ao_dsound.c @@ -426,7 +426,12 @@ static int init(int rate, int channels, int format, int flags) DSBUFFERDESC dsbpridesc; DSBUFFERDESC dsbdesc; - //check if the format is supported in general + //check if the channel count and format is supported in general + if (channels > 6) { + UninitDirectSound(); + mp_msg(MSGT_AO, MSGL_ERR, "ao_dsound: 8 channel audio not yet supported\n"); + return 0; + } switch(format){ case AF_FORMAT_AC3: case AF_FORMAT_S24_LE: diff --git a/libao2/ao_pcm.c b/libao2/ao_pcm.c index 9dc97e7554..9167521f12 100644 --- a/libao2/ao_pcm.c +++ b/libao2/ao_pcm.c @@ -244,7 +244,7 @@ static int play(void* data,int len,int flags){ } #endif - if (ao_data.channels == 6 || ao_data.channels == 5) { + if (ao_data.channels == 5 || ao_data.channels == 6 || ao_data.channels == 8) { int frame_size = le2me_16(wavhdr.bits) / 8; len -= len % (frame_size * ao_data.channels); reorder_channel_nch(data, AF_CHANNEL_LAYOUT_MPLAYER_DEFAULT, |