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

Unified Diff: media/audio/android/opensles_output.cc

Issue 10855218: Correct channel mask on android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed the comments. Created 8 years, 4 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 | « media/audio/android/opensles_input.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/android/opensles_output.cc
diff --git a/media/audio/android/opensles_output.cc b/media/audio/android/opensles_output.cc
index 7a4b68b3bd3d87f2a14bdb80b49e86a7ba3c14ae..3b5ee648c7f846c425ab40e9db7a30815b6fe839 100644
--- a/media/audio/android/opensles_output.cc
+++ b/media/audio/android/opensles_output.cc
@@ -26,8 +26,13 @@ OpenSLESOutputStream::OpenSLESOutputStream(AudioManagerAndroid* manager,
format_.samplesPerSec = static_cast<SLuint32>(params.sample_rate() * 1000);
format_.bitsPerSample = params.bits_per_sample();
format_.containerSize = params.bits_per_sample();
- format_.channelMask = SL_SPEAKER_FRONT_CENTER;
format_.endianness = SL_BYTEORDER_LITTLEENDIAN;
+ if (format_.numChannels == 1)
+ format_.channelMask = SL_SPEAKER_FRONT_CENTER;
+ else if (format_.numChannels == 2)
+ format_.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;
+ else
+ NOTREACHED() << "Unsupported number of channels: " << format_.numChannels;
buffer_size_bytes_ = params.GetBytesPerBuffer();
« no previous file with comments | « media/audio/android/opensles_input.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698