summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Effects.cpp
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2013-10-01 05:26:24 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-01 05:26:24 -0700
commit3424d6e17637e0743ddf3bf4688af8ee36e69264 (patch)
tree8589c02ab3b2e185cb06e030ae376cb38d730231 /services/audioflinger/Effects.cpp
parentd28076022746e36af16260da899718ab74a2b454 (diff)
parent1adf20ce868b80a24f7387daa6549364d5509c6a (diff)
downloadframeworks_av-3424d6e17637e0743ddf3bf4688af8ee36e69264.zip
frameworks_av-3424d6e17637e0743ddf3bf4688af8ee36e69264.tar.gz
frameworks_av-3424d6e17637e0743ddf3bf4688af8ee36e69264.tar.bz2
am 1adf20ce: Merge "fix volume and effect enable delay on offloaded tracks" into klp-dev
* commit '1adf20ce868b80a24f7387daa6549364d5509c6a': fix volume and effect enable delay on offloaded tracks
Diffstat (limited to 'services/audioflinger/Effects.cpp')
-rw-r--r--services/audioflinger/Effects.cpp22
1 files changed, 17 insertions, 5 deletions
diff --git a/services/audioflinger/Effects.cpp b/services/audioflinger/Effects.cpp
index 6e0354d..a8a5169 100644
--- a/services/audioflinger/Effects.cpp
+++ b/services/audioflinger/Effects.cpp
@@ -972,13 +972,20 @@ status_t AudioFlinger::EffectHandle::enable()
}
mEnabled = false;
} else {
- if (thread != 0 && !mEffect->isOffloadable()) {
- if ((thread->type() == ThreadBase::OFFLOAD)) {
+ if (thread != 0) {
+ if (thread->type() == ThreadBase::OFFLOAD) {
PlaybackThread *t = (PlaybackThread *)thread.get();
- t->invalidateTracks(AUDIO_STREAM_MUSIC);
+ Mutex::Autolock _l(t->mLock);
+ t->broadcast_l();
}
- if (mEffect->sessionId() == AUDIO_SESSION_OUTPUT_MIX) {
- thread->mAudioFlinger->onNonOffloadableGlobalEffectEnable();
+ if (!mEffect->isOffloadable()) {
+ if (thread->type() == ThreadBase::OFFLOAD) {
+ PlaybackThread *t = (PlaybackThread *)thread.get();
+ t->invalidateTracks(AUDIO_STREAM_MUSIC);
+ }
+ if (mEffect->sessionId() == AUDIO_SESSION_OUTPUT_MIX) {
+ thread->mAudioFlinger->onNonOffloadableGlobalEffectEnable();
+ }
}
}
}
@@ -1009,6 +1016,11 @@ status_t AudioFlinger::EffectHandle::disable()
sp<ThreadBase> thread = mEffect->thread().promote();
if (thread != 0) {
thread->checkSuspendOnEffectEnabled(mEffect, false, mEffect->sessionId());
+ if (thread->type() == ThreadBase::OFFLOAD) {
+ PlaybackThread *t = (PlaybackThread *)thread.get();
+ Mutex::Autolock _l(t->mLock);
+ t->broadcast_l();
+ }
}
return status;