diff options
author | Eric Laurent <elaurent@google.com> | 2014-10-01 14:26:10 -0700 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-10-01 16:52:30 -0700 |
commit | cb4b6e9f05d1c0b3fcc5be5ebe3f7d6f32669b1a (patch) | |
tree | 7bf2965353146579d1af3a5015ec468029d1f5dc /services/audioflinger/Effects.h | |
parent | a49c94ea49c8329a1bdefe980e1f7d335c0d1ec5 (diff) | |
download | frameworks_av-cb4b6e9f05d1c0b3fcc5be5ebe3f7d6f32669b1a.zip frameworks_av-cb4b6e9f05d1c0b3fcc5be5ebe3f7d6f32669b1a.tar.gz frameworks_av-cb4b6e9f05d1c0b3fcc5be5ebe3f7d6f32669b1a.tar.bz2 |
audioflinger: fix failure to indicate volume to effect
If an effect is added and enabled after a track is started
it will not receive current volume information because volume
is indicated only to active effects and if there is a volume change.
Add a flag to force EffectChain::setVolume_l() to pass volume indication
to all effects each time an effect is enabled.
Bug: 17572556.
Change-Id: I6b68488c9aca8b2095fb210aa124d02e4f759660
Diffstat (limited to 'services/audioflinger/Effects.h')
-rw-r--r-- | services/audioflinger/Effects.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/services/audioflinger/Effects.h b/services/audioflinger/Effects.h index eaf90e7..b87a1fd 100644 --- a/services/audioflinger/Effects.h +++ b/services/audioflinger/Effects.h @@ -318,6 +318,12 @@ public: // At least one non offloadable effect in the chain is enabled bool isNonOffloadableEnabled(); + // use release_cas because we don't care about the observed value, just want to make sure the + // new value is observable. + void forceVolume() { android_atomic_release_cas(false, true, &mForceVolume); } + // use acquire_cas because we are interested in the observed value and + // we are the only observers. + bool isVolumeForced() { return (android_atomic_acquire_cas(true, false, &mForceVolume) == 0); } void dump(int fd, const Vector<String16>& args); @@ -375,4 +381,5 @@ protected: // timeLow fields among effect type UUIDs. // Updated by updateSuspendedSessions_l() only. KeyedVector< int, sp<SuspendedEffectDesc> > mSuspendedEffects; + volatile int32_t mForceVolume; // force next volume command because a new effect was enabled }; |