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

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

Issue 93233003: Mute audio when volume is zero on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: henrika@'s comment Created 7 years 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/audio_manager_android.cc ('k') | 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_output.h
diff --git a/media/audio/android/opensles_output.h b/media/audio/android/opensles_output.h
index 7232d5da5f76210dee252f44946d141d075e19be..623b0193894ba87633dd3ec009565dfc094546ed 100644
--- a/media/audio/android/opensles_output.h
+++ b/media/audio/android/opensles_output.h
@@ -40,6 +40,10 @@ class OpenSLESOutputStream : public AudioOutputStream {
virtual void SetVolume(double volume) OVERRIDE;
virtual void GetVolume(double* volume) OVERRIDE;
+ // Set the value of |muted_|. It does not affect |volume_| which can be
+ // got by calling GetVolume(). See comments for |muted_| below.
+ void SetMute(bool muted);
+
private:
bool CreatePlayer();
@@ -96,6 +100,12 @@ class OpenSLESOutputStream : public AudioOutputStream {
bool started_;
+ // Volume control coming from hardware. It overrides |volume_| when it's
+ // true. Otherwise, use |volume_| for scaling.
+ // This is needed because platform voice volume never goes to zero in
+ // COMMUNICATION mode on Android.
+ bool muted_;
+
// Volume level from 0 to 1.
float volume_;
« no previous file with comments | « media/audio/android/audio_manager_android.cc ('k') | media/audio/android/opensles_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698