summaryrefslogtreecommitdiffstats
path: root/media/libnbaio
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-08-30 13:28:22 -0700
committerGlenn Kasten <gkasten@google.com>2013-09-03 15:19:03 -0700
commitfe346c707f59d763ded93bc3d27b51f0c0408258 (patch)
tree3e6f12ac7b37bc8ef10845c4c7ccdcfef4b51cd5 /media/libnbaio
parent4d0815d694e5a2edb3ce48427de50f55d0f84c0b (diff)
downloadframeworks_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 'media/libnbaio')
-rw-r--r--media/libnbaio/AudioStreamOutSink.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/media/libnbaio/AudioStreamOutSink.cpp b/media/libnbaio/AudioStreamOutSink.cpp
index b2de8a2..e4341d7 100644
--- a/media/libnbaio/AudioStreamOutSink.cpp
+++ b/media/libnbaio/AudioStreamOutSink.cpp
@@ -81,6 +81,9 @@ status_t AudioStreamOutSink::getNextWriteTimestamp(int64_t *timestamp) {
status_t AudioStreamOutSink::getTimestamp(AudioTimestamp& timestamp)
{
+ if (mStream->get_presentation_position == NULL) {
+ return INVALID_OPERATION;
+ }
// FIXME position64 won't be needed after AudioTimestamp.mPosition is changed to uint64_t
uint64_t position64;
int ok = mStream->get_presentation_position(mStream, &position64, &timestamp.mTime);