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

Commit 51ed38bb authored by Eino-Ville Talvala's avatar Eino-Ville Talvala Committed by Android (Google) Code Review
Browse files

Merge "BufferQueueProducer: Signal consumer when a buffer is detached" into nyc-dev

parents c2f184d9 93dd0518
Loading
Loading
Loading
Loading
+40 −31
Original line number Diff line number Diff line
@@ -553,6 +553,9 @@ status_t BufferQueueProducer::detachBuffer(int slot) {
    ATRACE_CALL();
    ATRACE_BUFFER_INDEX(slot);
    BQ_LOGV("detachBuffer: slot %d", slot);

    sp<IConsumerListener> listener;
    {
        Mutex::Autolock lock(mCore->mMutex);

        if (mCore->mIsAbandoned) {
@@ -590,6 +593,12 @@ status_t BufferQueueProducer::detachBuffer(int slot) {
        mCore->clearBufferSlotLocked(slot);
        mCore->mDequeueCondition.broadcast();
        VALIDATE_CONSISTENCY();
        listener = mCore->mConsumerListener;
    }

    if (listener != NULL) {
        listener->onBuffersReleased();
    }

    return NO_ERROR;
}