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

Unverified Commit adbf140b authored by Rajat Yadav's avatar Rajat Yadav Committed by Michael Bestas
Browse files

libgui: reset buffer count to max slots instead of returning BAD_VALUE.

CRs-Fixed: 3013293

Change-Id: Idfafcd6aa718054ff749bd5d1c7eb2630be0f109
parent a0d02a4f
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -164,13 +164,14 @@ status_t BufferQueueProducer::setMaxDequeuedBufferCount(int maxDequeuedBuffers,
            return BAD_VALUE;
            return BAD_VALUE;
        }
        }


        int bufferCount = mCore->getMinUndequeuedBufferCountLocked();
        int minUndequedBufferCount = mCore->getMinUndequeuedBufferCountLocked();
        bufferCount += maxDequeuedBuffers;
        int bufferCount = minUndequedBufferCount + maxDequeuedBuffers;


        if (bufferCount > BufferQueueDefs::NUM_BUFFER_SLOTS) {
        if (bufferCount > BufferQueueDefs::NUM_BUFFER_SLOTS) {
            BQ_LOGE("setMaxDequeuedBufferCount: bufferCount %d too large "
            BQ_LOGE("setMaxDequeuedBufferCount: bufferCount %d too large "
                    "(max %d)", bufferCount, BufferQueueDefs::NUM_BUFFER_SLOTS);
                    "(max %d)", bufferCount, BufferQueueDefs::NUM_BUFFER_SLOTS);
            return BAD_VALUE;
            bufferCount = BufferQueueDefs::NUM_BUFFER_SLOTS;
            maxDequeuedBuffers = bufferCount - minUndequedBufferCount;
        }
        }


        const int minBufferSlots = mCore->getMinMaxBufferCountLocked();
        const int minBufferSlots = mCore->getMinMaxBufferCountLocked();