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

Unified Diff: media/audio/android/opensles_input.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 | « no previous file | media/audio/android/opensles_output.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/android/opensles_input.cc
diff --git a/media/audio/android/opensles_input.cc b/media/audio/android/opensles_input.cc
index 3d0079efdd997e0a698f748fab69a4455332acdb..0df5bc1ca69d0dcd7197eca93e6259daaa9ae3ac 100644
--- a/media/audio/android/opensles_input.cc
+++ b/media/audio/android/opensles_input.cc
@@ -24,8 +24,13 @@ OpenSLESInputStream::OpenSLESInputStream(AudioManagerAndroid* audio_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 | « no previous file | media/audio/android/opensles_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698