Mercurial > mplayer.hg
changeset 12684:47598beff93a
ac3 passthrough, initial patch by Gianluigi Tiesi <sherpya at netfarm.it>
author | faust3 |
---|---|
date | Sat, 26 Jun 2004 11:20:20 +0000 |
parents | 411c38e35f0a |
children | b4587790a399 |
files | libao2/ao_win32.c |
diffstat | 1 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libao2/ao_win32.c Sat Jun 26 11:16:55 2004 +0000 +++ b/libao2/ao_win32.c Sat Jun 26 11:20:20 2004 +0000 @@ -121,11 +121,20 @@ //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