Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e125bba9 authored by aarti jadhav-gaikwad's avatar aarti jadhav-gaikwad Committed by Eric Laurent
Browse files

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
parent 2db91ae0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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);