Don't lock and then immediately unlock effect chains
Change-Id: Id9a4b1e9c49cecfd3a008a7814b5c14dad9a5831
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 1564a44..8bc70ba 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4283,7 +4283,8 @@
break;
case TrackBase::IDLE:
- break;
+ doSleep = true;
+ continue;
default:
LOG_FATAL("Unexpected activeTrackState %d", activeTrackState);
@@ -4293,12 +4294,8 @@
}
// thread mutex is now unlocked, mActiveTrack unknown, activeTrack != 0, kept, immutable
- // activeTrack->mState unknown, activeTrackState immutable
- if (activeTrackState != TrackBase::ACTIVE && activeTrackState != TrackBase::RESUMING) {
- unlockEffectChains(effectChains);
- doSleep = true;
- continue;
- }
+ // activeTrack->mState unknown, activeTrackState immutable and is ACTIVE or RESUMING
+
for (size_t i = 0; i < effectChains.size(); i ++) {
// thread mutex is not locked, but effect chain is locked
effectChains[i]->process_l();