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

Commit 4b7069da authored by Chong Zhang's avatar Chong Zhang
Browse files

Add FLAG_CAN_SEEK_BACKWARD and FLAG_CAN_SEEK_FORWARD see flags

Also update seek flag in NuPlayerDriver, otherwise MediaPlayer will
get wrong flags.

Bug: 10676387

Change-Id: Ice30f27a9a04e37b4718d26228a407fea8d9e4fc
parent c728c580
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -1396,6 +1396,11 @@ void NuPlayer::onSourceNotify(const sp<AMessage> &msg) {
            uint32_t flags;
            CHECK(msg->findInt32("flags", (int32_t *)&flags));

            sp<NuPlayerDriver> driver = mDriver.promote();
            if (driver != NULL) {
                driver->notifyFlagsChanged(flags);
            }

            if ((mSourceFlags & Source::FLAG_DYNAMIC_DURATION)
                    && (!(flags & Source::FLAG_DYNAMIC_DURATION))) {
                cancelPollDuration();
+4 −5
Original line number Diff line number Diff line
@@ -358,11 +358,10 @@ void NuPlayer::RTSPSource::onMessageReceived(const sp<AMessage> &msg) {
            uint32_t flags = 0;

            if (mHandler->isSeekable()) {
                flags = FLAG_CAN_PAUSE | FLAG_CAN_SEEK;

                // Seeking 10secs forward or backward is a very expensive
                // operation for rtsp, so let's not enable that.
                // The user can always use the seek bar.
                flags = FLAG_CAN_PAUSE
                        | FLAG_CAN_SEEK
                        | FLAG_CAN_SEEK_BACKWARD
                        | FLAG_CAN_SEEK_FORWARD;
            }

            notifyFlagsChanged(flags);