Simplify code that checks for record standby
Take advantage of the new processConfigEvents_l()
and it's post condition that mConfigEvents is empty.
Change-Id: Icd40fb175f3e374203c9c8d2e9df2c3929bed89b
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index c0e2939..c419807 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -380,6 +380,7 @@
processConfigEvents_l();
}
+// post condition: mConfigEvents.isEmpty()
void AudioFlinger::ThreadBase::processConfigEvents_l()
{
while (!mConfigEvents.isEmpty()) {
@@ -4214,15 +4215,14 @@
// It is only set to true while mLock held, but we don't hold mLock yet.
// Probably a benign race, but it would be safer to check exitPending with mLock held.
while (!exitPending()) {
-
- processConfigEvents();
-
Vector< sp<EffectChain> > effectChains;
+
{ // scope for mLock
Mutex::Autolock _l(mLock);
+ processConfigEvents_l();
// return value 'reconfig' is currently unused
bool reconfig = checkForNewParameters_l();
- if (mActiveTrack == 0 && mConfigEvents.isEmpty()) {
+ if (mActiveTrack == 0) {
standby();
if (exitPending()) {