Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(595)

Unified Diff: content/renderer/renderer_blink_platform_impl.cc

Issue 810763006: Support more than 8 channels for AudioContext.destination node on OSX (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Bring ToT Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/renderer_blink_platform_impl.cc
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index c4a009dc7ab3ff296833d3ed099402d86a7bbe44..a0053da509ccd0eebd860a956808edcf64308628 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -687,8 +687,6 @@ WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice(
// The |channels| does not exactly identify the channel layout of the
// device. The switch statement below assigns a best guess to the channel
// layout based on number of channels.
- // TODO(crogers): WebKit should give the channel layout instead of the hard
- // channel count.
media::ChannelLayout layout = media::CHANNEL_LAYOUT_UNSUPPORTED;
switch (channels) {
case 1:
@@ -716,7 +714,9 @@ WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice(
layout = media::CHANNEL_LAYOUT_7_1;
break;
default:
- layout = media::CHANNEL_LAYOUT_STEREO;
+ // If the layout is not supported (more than 9 channels), falls back to
+ // discrete mode.
+ layout = media::CHANNEL_LAYOUT_DISCRETE;
}
int session_id = 0;
@@ -728,9 +728,11 @@ WebAudioDevice* RendererBlinkPlatformImpl::createAudioDevice(
input_channels = 0;
}
+ // For CHANNEL_LAYOUT_DISCRETE, pass the explicit channel count along with
+ // the channel layout when creating an |AudioParameters| object.
media::AudioParameters params(
media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
- layout, static_cast<int>(sample_rate), 16, buffer_size,
+ layout, channels, static_cast<int>(sample_rate), 16, buffer_size,
media::AudioParameters::NO_EFFECTS);
return new RendererWebAudioDeviceImpl(params, callback, session_id);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698