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

Commit 02cccfd9 authored by Lajos Molnar's avatar Lajos Molnar
Browse files

stagefright: don't actually acquire graphic buffer when we don't want to

Bug: 37556535
Change-Id: Ic9d2bddd12c8a750c4d285a1915ac3f4455aceae
parent 89b67d60
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -897,7 +897,7 @@ void GraphicBufferSource::onFrameAvailable(const BufferItem& item __unused) {
    ++mNumAvailableUnacquiredBuffers;

    // For BufferQueue we cannot acquire a buffer if we cannot immediately feed it to the codec
    // OR we are discarding this buffer (acquiring and immediately releasing it), which makes
    // UNLESS we are discarding this buffer (acquiring and immediately releasing it), which makes
    // this an ugly logic.
    // NOTE: We could also rely on our debug counter but that is meant only as a debug counter.
    if (!areWeDiscardingAvailableBuffers_l() && mFreeCodecBuffers.empty()) {
@@ -906,6 +906,7 @@ void GraphicBufferSource::onFrameAvailable(const BufferItem& item __unused) {
        ALOGV("onFrameAvailable: cannot acquire buffer right now, do it later");

        ++mRepeatLastFrameGeneration; // cancel any pending frame repeat
        return;
    }

    VideoBuffer buffer;