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

Commit ff2599d6 authored by Steve Kondik's avatar Steve Kondik
Browse files

stagefright: Fix pause logic

 * This code can race during CTS. Only wait for HW decoders.

Change-Id: I4cfa049f06d27ca7ca9107ae31772f38392a8bc2
parent b309cf9d
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -5971,13 +5971,14 @@ status_t OMXCodec::pause() {
    CODEC_LOGV("pause mState=%d", mState);

    Mutex::Autolock autoLock(mLock);
    if (!strncmp(mComponentName, "OMX.qcom.", 9) && !mIsEncoder) {
        if (mState != EXECUTING) {
            return UNKNOWN_ERROR;
        }
        while (isIntermediateState(mState)) {
            mAsyncCompletion.wait(mLock);
        }
    if (!strncmp(mComponentName, "OMX.qcom.", 9) && !mIsEncoder) {

        status_t err = mOMX->sendCommand(mNode,
            OMX_CommandStateSet, OMX_StatePause);
        CHECK_EQ(err, (status_t)OK);