mirror of
https://github.com/mpv-player/mpv
synced 2025-03-25 04:38:01 +00:00
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
This commit is contained in:
parent
f75fd35c98
commit
1c6b68ba4d
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user