summaryrefslogtreecommitdiffstats
path: root/libao2/ao_dsound.c
diff options
context:
space:
mode:
Diffstat (limited to 'libao2/ao_dsound.c')
-rw-r--r--libao2/ao_dsound.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/libao2/ao_dsound.c b/libao2/ao_dsound.c
index f66042a793..c53820638d 100644
--- a/libao2/ao_dsound.c
+++ b/libao2/ao_dsound.c
@@ -327,7 +327,7 @@ static int write_buffer(unsigned char *data, int len)
if (SUCCEEDED(res))
{
- if( (ao_data.channels == 6) && (ao_data.format!=AF_FORMAT_AC3) ) {
+ if( (ao_data.channels == 6) && !AF_FORMAT_IS_AC3(ao_data.format) ) {
// reorder channels while writing to pointers.
// it's this easy because buffer size and len are always
// aligned to multiples of channels*bytespersample
@@ -432,8 +432,11 @@ static int init(int rate, int channels, int format, int flags)
mp_msg(MSGT_AO, MSGL_ERR, "ao_dsound: 8 channel audio not yet supported\n");
return 0;
}
+
+ if (AF_FORMAT_IS_AC3(format))
+ format = AF_FORMAT_AC3_NE;
switch(format){
- case AF_FORMAT_AC3:
+ case AF_FORMAT_AC3_NE:
case AF_FORMAT_S24_LE:
case AF_FORMAT_S16_LE:
case AF_FORMAT_U8:
@@ -456,7 +459,7 @@ static int init(int rate, int channels, int format, int flags)
wformat.Format.cbSize = (channels > 2) ? sizeof(WAVEFORMATEXTENSIBLE)-sizeof(WAVEFORMATEX) : 0;
wformat.Format.nChannels = channels;
wformat.Format.nSamplesPerSec = rate;
- if (format == AF_FORMAT_AC3) {
+ if (AF_FORMAT_IS_AC3(format)) {
wformat.Format.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF;
wformat.Format.wBitsPerSample = 16;
wformat.Format.nBlockAlign = 4;