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

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: 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') | media/audio/android/opensles_output.cc » ('J')
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..6800e45da436f87820ac5c4cb8f50eb7cb6e2170 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 channel " << format_.numChannels;
Raymond Toy (Google) 2012/08/17 16:14:33 Nit: I would say "Unsupported number of channels:
scherkus (not reviewing) 2012/08/17 17:47:12 do we need to set channelMask to something or is t
no longer working on chromium 2012/08/20 09:29:45 Done.
no longer working on chromium 2012/08/20 09:29:45 Good question. When the mask does not match the ch
buffer_size_bytes_ = params.GetBytesPerBuffer();
« no previous file with comments | « no previous file | media/audio/android/opensles_output.cc » ('j') | media/audio/android/opensles_output.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698