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

Unified Diff: content/renderer/media/audio_device.cc

Issue 10009037: Chrome 18 specific fix for fixing HTML5 audio output on Mac. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1025/src/
Patch Set: Created 8 years, 8 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/media/audio_device.cc
===================================================================
--- content/renderer/media/audio_device.cc (revision 131049)
+++ content/renderer/media/audio_device.cc (working copy)
@@ -95,6 +95,22 @@
AudioParameters params;
params.format = latency_format_;
params.channels = channels_;
+
+ // Chrome 18 specific fix for http://crbug.com/109441 where we determine the
+ // ChannelLayout based on |channels_| but only up to stereo. The proper fix
+ // was committed as r128054 in time for Chrome 19 but it's not suitable for
+ // merging.
+ //
+ // NOTE: surround sound will still be broken but that's something we'll have
+ // to live with until Chrome 19.
+ if (channels_ == 1) {
+ params.channel_layout = CHANNEL_LAYOUT_MONO;
+ } else if (channels_ == 2) {
+ params.channel_layout = CHANNEL_LAYOUT_STEREO;
+ } else {
+ params.channel_layout = CHANNEL_LAYOUT_NONE;
+ }
+
params.sample_rate = static_cast<int>(sample_rate_);
params.bits_per_sample = bits_per_sample_;
params.samples_per_packet = buffer_size_;
« 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