diff options
author | Glenn Kasten <gkasten@google.com> | 2013-08-30 13:28:22 -0700 |
---|---|---|
committer | Glenn Kasten <gkasten@google.com> | 2013-09-03 15:19:03 -0700 |
commit | fe346c707f59d763ded93bc3d27b51f0c0408258 (patch) | |
tree | 3e6f12ac7b37bc8ef10845c4c7ccdcfef4b51cd5 /services/audioflinger | |
parent | 4d0815d694e5a2edb3ce48427de50f55d0f84c0b (diff) | |
download | frameworks_av-fe346c707f59d763ded93bc3d27b51f0c0408258.zip frameworks_av-fe346c707f59d763ded93bc3d27b51f0c0408258.tar.gz frameworks_av-fe346c707f59d763ded93bc3d27b51f0c0408258.tar.bz2 |
Fix miscellanous AudioTrack::getTimestamp() bugs
Check that get_presentation_position is non-NULL before calling.
AudioTrack::getTimestamp not implemented for fast tracks.
Fix typo in Track::getTimestamp().
Fix bugs in AudioTrack::getTimestamp after stop:
- getTimestamp while stopped is not allowed.
- stop, start, getTimestamp now returns the correct value.
Change-Id: Ie8d9dc1f28d8927634e04175a68b147ffc2ea8eb
Diffstat (limited to 'services/audioflinger')
-rw-r--r-- | services/audioflinger/Tracks.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp index db67be6..2042050 100644 --- a/services/audioflinger/Tracks.cpp +++ b/services/audioflinger/Tracks.cpp @@ -727,9 +727,13 @@ status_t AudioFlinger::PlaybackThread::Track::setParameters(const String8& keyVa status_t AudioFlinger::PlaybackThread::Track::getTimestamp(AudioTimestamp& timestamp) { + // Client should implement this using SSQ; the unpresented frame count in latch is irrelevant + if (isFastTrack()) { + return INVALID_OPERATION; + } sp<ThreadBase> thread = mThread.promote(); if (thread == 0) { - return false; + return INVALID_OPERATION; } Mutex::Autolock _l(thread->mLock); PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); |