summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2011-12-13 11:47:54 -0800
committerGlenn Kasten <gkasten@google.com>2012-01-13 15:53:10 -0800
commite6f8a425da3fdcd512dfc19d2252e99abac555f4 (patch)
treeb3a5da7fb653c76a609f3b9f2233d839c7436d71 /services/audioflinger/AudioFlinger.h
parent6a78cd85867c5f22e4e82259b81fab46088331ad (diff)
downloadframeworks_base-e6f8a425da3fdcd512dfc19d2252e99abac555f4.zip
frameworks_base-e6f8a425da3fdcd512dfc19d2252e99abac555f4.tar.gz
frameworks_base-e6f8a425da3fdcd512dfc19d2252e99abac555f4.tar.bz2
Fix locking for mMasterVolume and mMute
mMasterVolume and mMute are both protected by mutex in AudioFlinger class, but there were two places where they were accessed without a mutex. Also make AudioFlinger::mMasterMute private not protected. Change-Id: Ia3897daeb5c50313df5bcc071824357526237f3e
Diffstat (limited to 'services/audioflinger/AudioFlinger.h')
-rw-r--r--services/audioflinger/AudioFlinger.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index f99e764..d22de26 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -765,7 +765,9 @@ private:
int16_t* mMixBuffer;
int mSuspended;
int mBytesWritten;
+ private:
bool mMasterMute;
+ protected:
SortedVector< wp<Track> > mActiveTracks;
virtual int getTrackName_l() = 0;
@@ -1388,6 +1390,8 @@ mutable Mutex mLock; // mutex for process, commands and handl
DefaultKeyedVector< int, sp<PlaybackThread> > mPlaybackThreads;
PlaybackThread::stream_type_t mStreamTypes[AUDIO_STREAM_CNT];
+
+ // both are protected by mLock
float mMasterVolume;
bool mMasterMute;
@@ -1399,6 +1403,9 @@ mutable Mutex mLock; // mutex for process, commands and handl
bool mBtNrecIsOff;
Vector<AudioSessionRef*> mAudioSessionRefs;
+
+ float masterVolume_l() const { return mMasterVolume; }
+ bool masterMute_l() const { return mMasterMute; }
};