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

Commit 99eb0f8d authored by Lajos Molnar's avatar Lajos Molnar Committed by android-build-merger
Browse files

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

am: 02cccfd9

Change-Id: I8eb1bfd6e18545ae148701114492e6a66f42effb
parents 9fa63515 02cccfd9
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;