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

Commit b19da8e1 authored by Gloria Wang's avatar Gloria Wang
Browse files

Fix for 2581725. Keep the last frame after resume(), and delete it

in the next suspend() or reuse it if no new frame is available.

Change-Id: I84286030eaae9061077d6ccb485b7dd53ef05341
parent bcac4960
Loading
Loading
Loading
Loading
+14 −2
Original line number Original line Diff line number Diff line
@@ -1239,7 +1239,19 @@ status_t AwesomePlayer::suspend() {
    Mutex::Autolock autoLock(mLock);
    Mutex::Autolock autoLock(mLock);


    if (mSuspensionState != NULL) {
    if (mSuspensionState != NULL) {
        return INVALID_OPERATION;
        if (mLastVideoBuffer == NULL) {
            //go into here if video is suspended again
            //after resuming without being played between
            //them
            SuspensionState *state = mSuspensionState;
            mSuspensionState = NULL;
            reset_l();
            mSuspensionState = state;
            return OK;
        }

        delete mSuspensionState;
        mSuspensionState = NULL;
    }
    }


    if (mFlags & PREPARING) {
    if (mFlags & PREPARING) {
@@ -1344,7 +1356,7 @@ status_t AwesomePlayer::resume() {
        play_l();
        play_l();
    }
    }


    delete state;
    mSuspensionState = state;
    state = NULL;
    state = NULL;


    return OK;
    return OK;