summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/audioflinger/Threads.cpp')
-rw-r--r--services/audioflinger/Threads.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index 12e09ab..66edf45 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -2126,6 +2126,7 @@ ssize_t AudioFlinger::PlaybackThread::threadLoop_write()
size_t totalFramesWritten = mNormalSink->framesWritten();
if (totalFramesWritten >= mLatchD.mTimestamp.mPosition) {
mLatchD.mUnpresentedFrames = totalFramesWritten - mLatchD.mTimestamp.mPosition;
+ // mLatchD.mFramesReleased is set in threadloop_mix()
mLatchDValid = true;
}
}
@@ -3093,6 +3094,18 @@ void AudioFlinger::MixerThread::threadLoop_mix()
sleepTime = 0;
standbyTime = systemTime() + standbyDelay;
//TODO: delay standby when effects have a tail
+
+ mLatchD.mFramesReleased.clear();
+ {
+ Mutex::Autolock _l(mLock);
+ size_t size = mActiveTracks.size();
+ for (size_t i = 0; i < size; i++) {
+ sp<Track> t = mActiveTracks[i].promote();
+ if (t != 0) {
+ mLatchD.mFramesReleased.add(t.get(), t->mAudioTrackServerProxy->framesReleased());
+ }
+ }
+ }
}
void AudioFlinger::MixerThread::threadLoop_sleepTime()