Rename updateWaitTime since a lock is held
Change-Id: I9bb978cbd0debf5b21676467060f72eebafea3e6
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index b972548..3b531bc 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -2067,9 +2067,7 @@
maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
}
-if (mType == DUPLICATING) {
- updateWaitTime();
-}
+ updateWaitTime_l();
activeSleepTime = activeSleepTimeUs();
idleSleepTime = idleSleepTimeUs();
@@ -3202,7 +3200,7 @@
thread->setStreamVolume(AUDIO_STREAM_CNT, 1.0f);
mOutputTracks.add(outputTrack);
ALOGV("addOutputTrack() track %p, on thread %p", outputTrack, thread);
- updateWaitTime();
+ updateWaitTime_l();
}
}
@@ -3213,14 +3211,15 @@
if (mOutputTracks[i]->thread() == thread) {
mOutputTracks[i]->destroy();
mOutputTracks.removeAt(i);
- updateWaitTime();
+ updateWaitTime_l();
return;
}
}
ALOGV("removeOutputTrack(): unkonwn thread: %p", thread);
}
-void AudioFlinger::DuplicatingThread::updateWaitTime()
+// caller must hold mLock
+void AudioFlinger::DuplicatingThread::updateWaitTime_l()
{
mWaitTimeMs = UINT_MAX;
for (size_t i = 0; i < mOutputTracks.size(); i++) {