summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/AudioPlayer.cpp
diff options
context:
space:
mode:
authorAndreas Huber <andih@google.com>2011-05-10 13:56:39 -0700
committerAndreas Huber <andih@google.com>2011-05-10 14:05:02 -0700
commitc0dfc5b02d4179769bbdd25c10d430576ec09568 (patch)
treedb15fa069e3b9b0f2f0e26961aa6716a270a4529 /media/libstagefright/AudioPlayer.cpp
parent70ccfd44c4bfe95ddecc2df6c3695efc48229d72 (diff)
downloadframeworks_av-c0dfc5b02d4179769bbdd25c10d430576ec09568.zip
frameworks_av-c0dfc5b02d4179769bbdd25c10d430576ec09568.tar.gz
frameworks_av-c0dfc5b02d4179769bbdd25c10d430576ec09568.tar.bz2
Properly honour any pending seek request when reading the first buffer after
starting the audio player. Change-Id: Ibedc1804a8c444e4d0f5be4eb87b22ed5d2c367d
Diffstat (limited to 'media/libstagefright/AudioPlayer.cpp')
-rw-r--r--media/libstagefright/AudioPlayer.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp
index 69f9c23..dd69e6b 100644
--- a/media/libstagefright/AudioPlayer.cpp
+++ b/media/libstagefright/AudioPlayer.cpp
@@ -84,7 +84,13 @@ status_t AudioPlayer::start(bool sourceAlreadyStarted) {
CHECK(mFirstBuffer == NULL);
- mFirstBufferResult = mSource->read(&mFirstBuffer);
+ MediaSource::ReadOptions options;
+ if (mSeeking) {
+ options.setSeekTo(mSeekTimeUs);
+ mSeeking = false;
+ }
+
+ mFirstBufferResult = mSource->read(&mFirstBuffer, &options);
if (mFirstBufferResult == INFO_FORMAT_CHANGED) {
LOGV("INFO_FORMAT_CHANGED!!!");