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

Commit d356b2d5 authored by Jamie Gennis's avatar Jamie Gennis Committed by Android (Google) Code Review
Browse files

Merge "SurfaceTexture: allow set_buffer_count(2)"

parents 115cf058 d995b083
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -168,18 +168,18 @@ status_t SurfaceTexture::setBufferCount(int bufferCount) {
        }
    }

    if (bufferCount == 0) {
    const int minBufferSlots = mSynchronousMode ?
            MIN_SYNC_BUFFER_SLOTS : MIN_ASYNC_BUFFER_SLOTS;
    if (bufferCount == 0) {
        mClientBufferCount = 0;
        bufferCount = (mServerBufferCount >= minBufferSlots) ?
                mServerBufferCount : minBufferSlots;
        return setBufferCountServerLocked(bufferCount);
    }

    // We don't allow the client to set a buffer-count less than
    // MIN_ASYNC_BUFFER_SLOTS (3), there is no reason for it.
    if (bufferCount < MIN_ASYNC_BUFFER_SLOTS) {
    if (bufferCount < minBufferSlots) {
        LOGE("setBufferCount: requested buffer count (%d) is less than "
                "minimum (%d)", bufferCount, minBufferSlots);
        return BAD_VALUE;
    }