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

Commit 3902be62 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

fix a small race condition when returning the default width/height of a SurfaceTexture

Change-Id: I581bf609505dfb5d4ec5957b2ef2c77df6cfb15f
parent eb2f227f
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -482,17 +482,16 @@ status_t SurfaceTexture::queueBuffer(int buf, int64_t timestamp,
        mSlots[buf].mScalingMode = mNextScalingMode;
        mSlots[buf].mTimestamp = timestamp;
        mDequeueCondition.signal();

        *outWidth = mDefaultWidth;
        *outHeight = mDefaultHeight;
        *outTransform = 0;
    } // scope for the lock

    // call back without lock held
    if (listener != 0) {
        listener->onFrameAvailable();
    }

    *outWidth = mDefaultWidth;
    *outHeight = mDefaultHeight;
    *outTransform = 0;

    return OK;
}