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

Commit 8025b01e authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer2: skip consecutive seeks except last one"

parents beffea1d 5cbdad41
Loading
Loading
Loading
Loading
+11 −0
Original line number Original line Diff line number Diff line
@@ -3620,6 +3620,17 @@ public final class MediaPlayer2Impl extends MediaPlayer2 {
                        && getState() == PLAYER_STATE_ERROR) {
                        && getState() == PLAYER_STATE_ERROR) {
                    status = CALL_STATUS_INVALID_OPERATION;
                    status = CALL_STATUS_INVALID_OPERATION;
                } else {
                } else {
                    if (mMediaCallType == CALL_COMPLETED_SEEK_TO) {
                        synchronized (mTaskLock) {
                            if (!mPendingTasks.isEmpty()) {
                                Task nextTask = mPendingTasks.get(0);
                                if (nextTask.mMediaCallType == mMediaCallType) {
                                    throw new CommandSkippedException(
                                            "consecutive seekTo is skipped except last one");
                                }
                            }
                        }
                    }
                    process();
                    process();
                }
                }
            } catch (IllegalStateException e) {
            } catch (IllegalStateException e) {