diff options
author | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 19:08:57 +0000 |
---|---|---|
committer | fbarchard@chromium.org <fbarchard@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-10-22 19:08:57 +0000 |
commit | a84d2384f1cb2930260bd2f4f5e0033122e8cef5 (patch) | |
tree | a9832996dd27f3320ef38deadda4a7a36c2a591d /media | |
parent | 50f33bfac6f122fdccc57771aa1307346f605540 (diff) | |
download | chromium_src-a84d2384f1cb2930260bd2f4f5e0033122e8cef5.zip chromium_src-a84d2384f1cb2930260bd2f4f5e0033122e8cef5.tar.gz chromium_src-a84d2384f1cb2930260bd2f4f5e0033122e8cef5.tar.bz2 |
add channel mask for 6.1 surround when 7 channel audio is specified
BUG=60329
TEST=play 6.1 on a 6.1 stereo and ensure sound is playing in the correct speakers
Review URL: http://codereview.chromium.org/4072002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63542 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'media')
-rw-r--r-- | media/audio/win/waveout_output_win.cc | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/media/audio/win/waveout_output_win.cc b/media/audio/win/waveout_output_win.cc index 0865477..27b3e03 100644 --- a/media/audio/win/waveout_output_win.cc +++ b/media/audio/win/waveout_output_win.cc @@ -65,16 +65,27 @@ PCMWaveOutAudioOutputStream::PCMWaveOutAudioOutputStream( format_.Format.wBitsPerSample) / 8; format_.Format.nAvgBytesPerSec = format_.Format.nBlockAlign * format_.Format.nSamplesPerSec; - // This mask handles Stereo, 5.1 and 7.1. - // TODO(fbarchard): Support masks for other channel layouts. - format_.dwChannelMask = SPEAKER_FRONT_LEFT | - SPEAKER_FRONT_RIGHT | - SPEAKER_FRONT_CENTER | - SPEAKER_LOW_FREQUENCY | - SPEAKER_BACK_LEFT | - SPEAKER_BACK_RIGHT | - SPEAKER_SIDE_LEFT | - SPEAKER_SIDE_RIGHT; + // This mask handles 6.1 + if (params.channels == 7) { + format_.dwChannelMask = SPEAKER_FRONT_LEFT | + SPEAKER_FRONT_RIGHT | + SPEAKER_FRONT_CENTER | + SPEAKER_LOW_FREQUENCY | + SPEAKER_BACK_LEFT | + SPEAKER_BACK_RIGHT | + SPEAKER_BACK_CENTER; + } else { + // This mask handles mono, stereo, 5.1, 7.1 + // TODO(fbarchard): Support masks for other channel layouts. + format_.dwChannelMask = SPEAKER_FRONT_LEFT | + SPEAKER_FRONT_RIGHT | + SPEAKER_FRONT_CENTER | + SPEAKER_LOW_FREQUENCY | + SPEAKER_BACK_LEFT | + SPEAKER_BACK_RIGHT | + SPEAKER_SIDE_LEFT | + SPEAKER_SIDE_RIGHT; + } format_.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; format_.Samples.wValidBitsPerSample = params.bits_per_sample; // The event is auto-reset. |