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

Commit 9121a20b authored by Sungtak Lee's avatar Sungtak Lee Committed by Cherrypicker Worker
Browse files

C2BqPool: Do not call cancelBuffer() after invalidated

Do not call IGBP::cancelBuffer() from C2BqPool based blocks after the
Pool is invalidated.

Bug: 304183768
Test: atest android.media.decoder.cts.AdaptivePlaybackTest
(cherry picked from https://android-review.googlesource.com/q/commit:912d7b02cbf2eb1aa2e6dfaca800938fbdcc8603)
Merged-In: Ic03a42077c5e752722c3c7c654e03c4f6fedde4d
Change-Id: Ic03a42077c5e752722c3c7c654e03c4f6fedde4d
parent 3d0d0ba0
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@
#include <C2FenceFactory.h>
#include <C2SurfaceSyncObj.h>

#include <atomic>
#include <list>
#include <map>
#include <mutex>
@@ -750,8 +751,8 @@ public:
    }

    void invalidate() {
        std::scoped_lock<std::mutex> lock(mMutex);
        mInvalidated = true;
        mIgbpValidityToken.reset();
    }

private:
@@ -791,7 +792,7 @@ private:
    // if the token has been expired, the buffers will not call IGBP::cancelBuffer()
    // when they are no longer used.
    std::shared_ptr<int> mIgbpValidityToken;
    bool mInvalidated{false};
    std::atomic<bool> mInvalidated{false};
};

C2BufferQueueBlockPoolData::C2BufferQueueBlockPoolData(