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

Commit 4ad74b2b authored by Wei Jia's avatar Wei Jia
Browse files

RTSP: increase mCheckGeneration when mCheckPending is set to false.

This will ensure there is only one 'chek' message.
Also delay notification of seek done till kWhatSeekDone, instead of
kWhatSeekPaused. This allows back-to-back multiple seeks.

Bug: 25727912
Change-Id: If873bfaf1c37790e520f1f659ab26148b0c8cd1c
parent 3aaa699a
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -385,10 +385,8 @@ void NuPlayer::RTSPSource::onMessageReceived(const sp<AMessage> &msg) {
        case MyHandler::kWhatSeekDone:
        {
            mState = CONNECTED;
            if (mSeekReplyID != NULL) {
            // Unblock seekTo here in case we attempted to seek in a live stream
            finishSeek(OK);
            }
            break;
        }

@@ -409,12 +407,13 @@ void NuPlayer::RTSPSource::onMessageReceived(const sp<AMessage> &msg) {

            status_t err = OK;
            msg->findInt32("err", &err);
            finishSeek(err);

            if (err == OK) {
                int64_t timeUs;
                CHECK(msg->findInt64("time", &timeUs));
                mHandler->continueSeekAfterPause(timeUs);
            } else {
                finishSeek(err);
            }
            break;
        }
@@ -749,7 +748,9 @@ bool NuPlayer::RTSPSource::stopBufferingIfNecessary() {
}

void NuPlayer::RTSPSource::finishSeek(status_t err) {
    CHECK(mSeekReplyID != NULL);
    if (mSeekReplyID == NULL) {
        return;
    }
    sp<AMessage> seekReply = new AMessage;
    seekReply->setInt32("err", err);
    seekReply->postReply(mSeekReplyID);
+2 −0
Original line number Diff line number Diff line
@@ -1135,6 +1135,7 @@ struct MyHandler : public AHandler {
                     result, strerror(-result));

                mCheckPending = false;
                ++mCheckGeneration;
                postAccessUnitTimeoutCheck();

                if (result == OK) {
@@ -1286,6 +1287,7 @@ struct MyHandler : public AHandler {
                     result, strerror(-result));

                mCheckPending = false;
                ++mCheckGeneration;
                postAccessUnitTimeoutCheck();

                if (result == OK) {