diff options
author | aarti jadhav-gaikwad <agaikwad@nvidia.com> | 2014-06-19 17:43:01 +0530 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-07-11 21:25:43 +0000 |
commit | e125bba94afe74df330c661ab0a64b1e9e2ac5b7 (patch) | |
tree | 5a5a1faa45b7d79526436aaeca53dc2da5e6a8d3 | |
parent | 2db91ae0e6aa33b50cc924ad65d6dc01876d220f (diff) | |
download | frameworks_av-e125bba94afe74df330c661ab0a64b1e9e2ac5b7.zip frameworks_av-e125bba94afe74df330c661ab0a64b1e9e2ac5b7.tar.gz frameworks_av-e125bba94afe74df330c661ab0a64b1e9e2ac5b7.tar.bz2 |
stagefright: Return correct play position after EOS
In case of offload getOutputPlayPositionUs_l returns
zero on reaching EOS. Return duration as position.
Bug: 15770459
Change-Id: I7aeafdc315a86ccd197d555d604e1069eead3153
-rw-r--r-- | media/libstagefright/AudioPlayer.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/media/libstagefright/AudioPlayer.cpp b/media/libstagefright/AudioPlayer.cpp index 04fc88b..e24824b 100644 --- a/media/libstagefright/AudioPlayer.cpp +++ b/media/libstagefright/AudioPlayer.cpp @@ -766,6 +766,11 @@ int64_t AudioPlayer::getMediaTimeUs() { if (mSeeking) { return mSeekTimeUs; } + if (mReachedEOS) { + int64_t durationUs; + mSource->getFormat()->findInt64(kKeyDuration, &durationUs); + return durationUs; + } mPositionTimeRealUs = getOutputPlayPositionUs_l(); ALOGV("getMediaTimeUs getOutputPlayPositionUs_l() mPositionTimeRealUs %" PRId64, mPositionTimeRealUs); |