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

Commit 3c578f2d authored by Gloria Wang's avatar Gloria Wang
Browse files

When switching surface, do not set mSeekNotificationSent as true,

because there could be a previous uncompleted seeking which needs
to send back MEDIA_SEEK_COMPLETE message. If we set mSeekNotificationSent
as true here, then mediaplayer.cpp will be waiting for message
MEDIA_SEEK_COMPLETE. The getCurrentPosition() will always return
the seek time before MEDIA_SEEK_COMPLETE being received by mediaplayer.cpp.
Fix for bug 5181272.

Change-Id: I290aff29b6d9ec8db67c66abbe1f352a43f57073
parent 5a9ffaa4
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -548,7 +548,7 @@ void AwesomePlayer::reset_l() {
    mVideoTimeUs = 0;

    mSeeking = NO_SEEK;
    mSeekNotificationSent = false;
    mSeekNotificationSent = true;
    mSeekTimeUs = 0;

    mUri.setTo("");
@@ -1204,7 +1204,6 @@ void AwesomePlayer::setNativeWindow_l(const sp<ANativeWindow> &native) {

    if (mLastVideoTimeUs >= 0) {
        mSeeking = SEEK;
        mSeekNotificationSent = true;
        mSeekTimeUs = mLastVideoTimeUs;
        modifyFlags((AT_EOS | AUDIO_AT_EOS | VIDEO_AT_EOS), CLEAR);
    }
@@ -1305,9 +1304,11 @@ void AwesomePlayer::OnRTSPSeekDoneWrapper(void *cookie) {
}

void AwesomePlayer::onRTSPSeekDone() {
    if (!mSeekNotificationSent) {
        notifyListener_l(MEDIA_SEEK_COMPLETE);
        mSeekNotificationSent = true;
    }
}

status_t AwesomePlayer::seekTo_l(int64_t timeUs) {
    if (mRTSPController != NULL) {