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

Commit 14ae2c0d authored by Wei Jia's avatar Wei Jia Committed by Android (Google) Code Review
Browse files

Merge "ACodec: call cancelBufferToNativeWindow() only when the buffer is owned by us." into mnc-dev

parents b6b19ca7 3175d2ba
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1063,11 +1063,13 @@ status_t ACodec::allocateOutputBuffersFromNativeWindow() {

    for (OMX_U32 i = cancelStart; i < cancelEnd; i++) {
        BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i);
        if (info->mStatus == BufferInfo::OWNED_BY_US) {
            status_t error = cancelBufferToNativeWindow(info);
            if (err == 0) {
                err = error;
            }
        }
    }

    if (!storingMetadataInDecodedBuffers()) {
        static_cast<Surface*>(mNativeWindow.get())
@@ -1152,11 +1154,13 @@ status_t ACodec::allocateOutputMetadataBuffers() {

        for (OMX_U32 i = 0; i < mBuffers[kPortIndexOutput].size(); i++) {
            BufferInfo *info = &mBuffers[kPortIndexOutput].editItemAt(i);
            if (info->mStatus == BufferInfo::OWNED_BY_US) {
                status_t error = cancelBufferToNativeWindow(info);
                if (err == OK) {
                    err = error;
                }
            }
        }

        static_cast<Surface*>(mNativeWindow.get())
                ->getIGraphicBufferProducer()->allowAllocation(false);