summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-10-01 23:09:52 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-10-01 23:09:53 +0000
commita49c94ea49c8329a1bdefe980e1f7d335c0d1ec5 (patch)
treec095d3a59114c8a893e3657ad5efc6fdb40f2c9b /services/audioflinger/Tracks.cpp
parentd0b9efe7d8300e48f7a99c1dd746d60060206b3c (diff)
parent6954127b7ace022677ac407ff943c2793f8a11be (diff)
downloadframeworks_av-a49c94ea49c8329a1bdefe980e1f7d335c0d1ec5.zip
frameworks_av-a49c94ea49c8329a1bdefe980e1f7d335c0d1ec5.tar.gz
frameworks_av-a49c94ea49c8329a1bdefe980e1f7d335c0d1ec5.tar.bz2
Merge "Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"" into lmp-dev
Diffstat (limited to 'services/audioflinger/Tracks.cpp')
-rw-r--r--services/audioflinger/Tracks.cpp10
1 files changed, 1 insertions, 9 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index b2d53cf..75190f3 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -898,15 +898,7 @@ status_t AudioFlinger::PlaybackThread::Track::getTimestamp(AudioTimestamp& times
uint32_t unpresentedFrames =
((int64_t) playbackThread->mLatchQ.mUnpresentedFrames * mSampleRate) /
playbackThread->mSampleRate;
- // FIXME Since we're using a raw pointer as the key, it is theoretically possible
- // for a brand new track to share the same address as a recently destroyed
- // track, and thus for us to get the frames released of the wrong track.
- // It is unlikely that we would be able to call getTimestamp() so quickly
- // right after creating a new track. Nevertheless, the index here should
- // be changed to something that is unique. Or use a completely different strategy.
- ssize_t i = playbackThread->mLatchQ.mFramesReleased.indexOfKey(this);
- uint32_t framesWritten = i >= 0 ?
- playbackThread->mLatchQ.mFramesReleased[i] : mAudioTrackServerProxy->framesReleased();
+ uint32_t framesWritten = mAudioTrackServerProxy->framesReleased();
bool checkPreviousTimestamp = mPreviousValid && framesWritten >= mPreviousFramesWritten;
if (framesWritten < unpresentedFrames) {
mPreviousValid = false;