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

Commit 7e87bb67 authored by Treehugger Robot's avatar Treehugger Robot Committed by Automerger Merge Worker
Browse files

Merge "MediaCodec: force synchronous release if setting release surface fails"...

Merge "MediaCodec: force synchronous release if setting release surface fails" am: 8700acf8 am: 61e5a4cc am: 1d91bf76

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/2094347



Change-Id: I8aa659d55fc8d1c3c9e29aed9b178592ea4b63e6
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents bd04de7d 1d91bf76
Loading
Loading
Loading
Loading
+26 −21
Original line number Diff line number Diff line
@@ -4155,8 +4155,8 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
                break;
            }

            if (asyncNotify != nullptr) {
                if (mSurface != NULL) {
            bool forceSync = false;
            if (asyncNotify != nullptr && mSurface != NULL) {
                if (!mReleaseSurface) {
                    uint64_t usage = 0;
                    if (mSurface->getConsumerUsage(&usage) != OK) {
@@ -4174,7 +4174,10 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
                    if (err == OK) {
                        (void)disconnectFromSurface();
                        mSurface = mReleaseSurface->getSurface();
                        }
                    } else {
                        // We were not able to switch the surface, so force
                        // synchronous release.
                        forceSync = true;
                    }
                }
            }
@@ -4198,8 +4201,10 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
            }

            if (asyncNotify != nullptr) {
                if (!forceSync) {
                    mResourceManagerProxy->markClientForPendingRemoval();
                    postPendingRepliesAndDeferredMessages("kWhatRelease:async");
                }
                asyncNotifyPost.clear();
                mAsyncReleaseCompleteNotification = asyncNotify;
            }