summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2014-10-02 13:48:16 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-10-02 13:48:16 +0000
commit4113fe9dcbcda53d09f9b9c91f59d9a54e6c2408 (patch)
tree1f343dd021b0195b8894661a2bc79e16db424c44 /services/audioflinger/Tracks.cpp
parente7c6790095545fa4e2bd6d534ae8d8a6fb486f37 (diff)
parent0e42a8807edec5541ecac4a050459fbb72c477dc (diff)
downloadframeworks_av-4113fe9dcbcda53d09f9b9c91f59d9a54e6c2408.zip
frameworks_av-4113fe9dcbcda53d09f9b9c91f59d9a54e6c2408.tar.gz
frameworks_av-4113fe9dcbcda53d09f9b9c91f59d9a54e6c2408.tar.bz2
am 0e42a880: am e5095be1: am a49c94ea: Merge "Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"" into lmp-dev
* commit '0e42a8807edec5541ecac4a050459fbb72c477dc': Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"
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 c6c0ac1..8793f4a 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -899,15 +899,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;