diff options
author | Glenn Kasten <gkasten@google.com> | 2012-02-14 09:44:47 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-02-14 09:44:47 -0800 |
commit | 6dad4378f2a78d967defc8912ecf47f6ed117584 (patch) | |
tree | fb4fa4804cfa198fe6a625993c7cff520a492be8 /services/audioflinger/AudioFlinger.h | |
parent | d9b9b8d09e7471b0ffa21cfa9f944ef4ad300a71 (diff) | |
parent | 6637baae4244aec731c4014da72418d330636ae1 (diff) | |
download | frameworks_av-6dad4378f2a78d967defc8912ecf47f6ed117584.zip frameworks_av-6dad4378f2a78d967defc8912ecf47f6ed117584.tar.gz frameworks_av-6dad4378f2a78d967defc8912ecf47f6ed117584.tar.bz2 |
Merge "Fix races related to volume and mute"
Diffstat (limited to 'services/audioflinger/AudioFlinger.h')
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h index 48a23fa..aa0b8f8 100644 --- a/services/audioflinger/AudioFlinger.h +++ b/services/audioflinger/AudioFlinger.h @@ -709,17 +709,13 @@ private: virtual uint32_t latency() const; - virtual status_t setMasterVolume(float value); - virtual status_t setMasterMute(bool muted); + void setMasterVolume(float value); + void setMasterMute(bool muted); - virtual float masterVolume() const { return mMasterVolume; } - virtual bool masterMute() const { return mMasterMute; } + void setStreamVolume(audio_stream_type_t stream, float value); + void setStreamMute(audio_stream_type_t stream, bool muted); - virtual status_t setStreamVolume(audio_stream_type_t stream, float value); - virtual status_t setStreamMute(audio_stream_type_t stream, bool muted); - - virtual float streamVolume(audio_stream_type_t stream) const; - virtual bool streamMute(audio_stream_type_t stream) const; + float streamVolume(audio_stream_type_t stream) const; sp<Track> createTrack_l( const sp<AudioFlinger::Client>& client, @@ -766,6 +762,7 @@ private: // PlaybackThread needs to find out if master-muted, it checks it's local // copy rather than the one in AudioFlinger. This optimization saves a lock. bool mMasterMute; + void setMasterMute_l(bool muted) { mMasterMute = muted; } protected: SortedVector< wp<Track> > mActiveTracks; @@ -891,7 +888,11 @@ private: PlaybackThread *checkPlaybackThread_l(audio_io_handle_t output) const; MixerThread *checkMixerThread_l(audio_io_handle_t output) const; RecordThread *checkRecordThread_l(audio_io_handle_t input) const; - float streamVolumeInternal(audio_stream_type_t stream) const + // no range check, AudioFlinger::mLock held + bool streamMute_l(audio_stream_type_t stream) const + { return mStreamTypes[stream].mute; } + // no range check, doesn't check per-thread stream volume, AudioFlinger::mLock held + float streamVolume_l(audio_stream_type_t stream) const { return mStreamTypes[stream].volume; } void audioConfigChanged_l(int event, audio_io_handle_t ioHandle, void *param2); |