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

Commit 24206b2a authored by Brijesh Patel's avatar Brijesh Patel Committed by Lajos Molnar
Browse files

CameraSource: Remove CHECK if set preview target fails with CameraSource

- Surface set might be incorrect or is already associated with another
  graphic buffer producer causing assert.

Bug: b/208475703
Change-Id: I57b533e2002b7f7b6bf5a7907ab941b54a7f2dc4
parent 6100fd64
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -564,9 +564,11 @@ status_t CameraSource::initWithCameraAccess(
    // Set the preview display. Skip this if mSurface is null because
    // applications may already set a surface to the camera.
    if (mSurface != NULL) {
        // This CHECK is good, since we just passed the lock/unlock
        // check earlier by calling mCamera->setParameters().
        CHECK_EQ((status_t)OK, mCamera->setPreviewTarget(mSurface));
        // Surface may be set incorrectly or could already be used even if we just
        // passed the lock/unlock check earlier by calling mCamera->setParameters().
        if ((err = mCamera->setPreviewTarget(mSurface)) != OK) {
            return err;
        }
    }

    // Use buffer queue to receive video buffers from camera