diff options
author | Glenn Kasten <gkasten@google.com> | 2012-03-06 11:24:48 -0800 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2012-03-06 12:46:21 -0800 |
commit | 438b036deaf4413503567a75a2861c000d21da5b (patch) | |
tree | 05fe0bad8c24d4e7e95bf20a61bad745a62221e4 /services | |
parent | 70a1577d42c6e222c98f0245e7b81b0e8bc238f7 (diff) | |
download | frameworks_av-438b036deaf4413503567a75a2861c000d21da5b.zip frameworks_av-438b036deaf4413503567a75a2861c000d21da5b.tar.gz frameworks_av-438b036deaf4413503567a75a2861c000d21da5b.tar.bz2 |
Rename updateWaitTime since a lock is held
Change-Id: I9bb978cbd0debf5b21676467060f72eebafea3e6
Diffstat (limited to 'services')
-rw-r--r-- | services/audioflinger/AudioFlinger.cpp | 11 | ||||
-rw-r--r-- | services/audioflinger/AudioFlinger.h | 6 |
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; |