summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-03-06 11:24:48 -0800
committerGlenn Kasten <gkasten@google.com>2012-03-06 12:46:21 -0800
commit2bad67f3e33f74bdd3a8265e9a00a38e4d43e005 (patch)
tree1186e7790197e105936e38c6ea4052068f4161b4
parent66199cf939efbffb9154df89f85d0d30c8d3ec55 (diff)
downloadframeworks_base-2bad67f3e33f74bdd3a8265e9a00a38e4d43e005.zip
frameworks_base-2bad67f3e33f74bdd3a8265e9a00a38e4d43e005.tar.gz
frameworks_base-2bad67f3e33f74bdd3a8265e9a00a38e4d43e005.tar.bz2
Rename updateWaitTime since a lock is held
Change-Id: I9bb978cbd0debf5b21676467060f72eebafea3e6
-rw-r--r--services/audioflinger/AudioFlinger.cpp11
-rw-r--r--services/audioflinger/AudioFlinger.h6
2 files changed, 9 insertions, 8 deletions
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 @@ if (mType == MIXER) {
maxPeriod = seconds(mFrameCount) / mSampleRate * 15;
}
-if (mType == DUPLICATING) {
- updateWaitTime();
-}
+ updateWaitTime_l();
activeSleepTime = activeSleepTimeUs();
idleSleepTime = idleSleepTimeUs();
@@ -3202,7 +3200,7 @@ void AudioFlinger::DuplicatingThread::addOutputTrack(MixerThread *thread)
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 @@ void AudioFlinger::DuplicatingThread::removeOutputTrack(MixerThread *thread)
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++) {
diff --git a/services/audioflinger/AudioFlinger.h b/services/audioflinger/AudioFlinger.h
index c7ac0a8..28b33a2 100644
--- a/services/audioflinger/AudioFlinger.h
+++ b/services/audioflinger/AudioFlinger.h
@@ -812,7 +812,7 @@ protected:
virtual void threadLoop_standby();
// Non-trivial for DUPLICATING only
- virtual void updateWaitTime() { }
+ virtual void updateWaitTime_l() { }
// Non-trivial for DIRECT only
virtual void applyVolume() { }
@@ -1046,7 +1046,9 @@ public:
virtual void threadLoop_sleepTime();
virtual void threadLoop_write();
virtual void threadLoop_standby();
- virtual void updateWaitTime();
+
+ // called from threadLoop, addOutputTrack, removeOutputTrack
+ virtual void updateWaitTime_l();
private:
uint32_t mWaitTimeMs;