diff options
author | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-06-26 11:20:20 +0000 |
---|---|---|
committer | faust3 <faust3@b3059339-0415-0410-9bf9-f77b7e298cf2> | 2004-06-26 11:20:20 +0000 |
commit | 1c6b68ba4dfde2d9c946c0086707d936320354b6 (patch) | |
tree | 38f469976e32777c8e0f9a397e745113c2c099f3 | |
parent | f75fd35c98aa7ac026c75861f65f1c0f220c1b30 (diff) |
ac3 passthrough, initial patch by Gianluigi Tiesi <sherpya at netfarm.it>
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12685 b3059339-0415-0410-9bf9-f77b7e298cf2
-rw-r--r-- | libao2/ao_win32.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libao2/ao_win32.c b/libao2/ao_win32.c index 46d070b982..953858a166 100644 --- a/libao2/ao_win32.c +++ b/libao2/ao_win32.c @@ -121,11 +121,20 @@ static int init(int rate,int channels,int format,int flags) //fill waveformatex ZeroMemory( &wformat, sizeof(WAVEFORMATEX)); wformat.cbSize = 0; /* size of _extra_ info */ - wformat.wFormatTag = WAVE_FORMAT_PCM; wformat.nChannels = channels; wformat.nSamplesPerSec = rate; - wformat.wBitsPerSample = audio_out_format_bits(format); - wformat.nBlockAlign = wformat.nChannels * (wformat.wBitsPerSample >> 3); + if(format == AFMT_AC3) + { + wformat.wFormatTag = WAVE_FORMAT_DOLBY_AC3_SPDIF; + wformat.wBitsPerSample = 16; + wformat.nBlockAlign = 4; + } + else + { + wformat.wFormatTag = WAVE_FORMAT_PCM; + wformat.wBitsPerSample = audio_out_format_bits(format); + wformat.nBlockAlign = wformat.nChannels * (wformat.wBitsPerSample >> 3); + } wformat.nAvgBytesPerSec = wformat.nSamplesPerSec * wformat.nBlockAlign; //open sound device |