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

Commit 6b4382b8 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" into tm-dev am: db9911c9 am: cd1bdd8d

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



Change-Id: Iab2b821d61456edeb4e3b1297bed10401645a1be
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 773e4a25 cd1bdd8d
Loading
Loading
Loading
Loading
+26 −21
Original line number Diff line number Diff line
@@ -4222,8 +4222,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) {
@@ -4241,7 +4241,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;
                    }
                }
            }
@@ -4265,8 +4268,10 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
            }

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