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

Commit 9ec10a72 authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "MediaPlayer: disallow calling setPlaybackParams in stopped state." into nyc-mr1-dev

parents 85eb70d6 5af6a9b4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -395,7 +395,9 @@ status_t MediaPlayer::setPlaybackSettings(const AudioPlaybackRate& rate)
        return BAD_VALUE;
    }
    Mutex::Autolock _l(mLock);
    if (mPlayer == 0) return INVALID_OPERATION;
    if (mPlayer == 0 || (mCurrentState & MEDIA_PLAYER_STOPPED)) {
        return INVALID_OPERATION;
    }

    if (rate.mSpeed != 0.f && !(mCurrentState & MEDIA_PLAYER_STARTED)
            && (mCurrentState & (MEDIA_PLAYER_PREPARED | MEDIA_PLAYER_PAUSED