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

Commit 5af6a9b4 authored by Wei Jia's avatar Wei Jia
Browse files

MediaPlayer: disallow calling setPlaybackParams in stopped state.

Bug: 29420829
Change-Id: Iaba71f3b975022f150962fa306c2426c61457820
parent 2dd12498
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