diff options
author | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-25 15:04:07 +0200 |
---|---|---|
committer | Uoti Urpala <uau@glyph.nonexistent.invalid> | 2010-01-25 15:07:30 +0200 |
commit | 69fe2522f8c2a04eda112eee6319ca2e85d7038b (patch) | |
tree | 83a8b19997e621309344ca1f3997a48886ef0944 /libao2/ao_dsound.c | |
parent | 9436e0452fad48e671d7320cb18c588655f3d230 (diff) | |
parent | 1cda8b002fb19c3da14760fe1f9fc76992a05c29 (diff) | |
download | mpv-69fe2522f8c2a04eda112eee6319ca2e85d7038b.tar.bz2 mpv-69fe2522f8c2a04eda112eee6319ca2e85d7038b.tar.xz |
Merge svn changes up to r30301
Diffstat (limited to 'libao2/ao_dsound.c')
-rw-r--r-- | libao2/ao_dsound.c | 9 |
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; |