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

Commit 8700acf8 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

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

parents c0845eab dd67a5ff
Loading
Loading
Loading
Loading
+26 −21
Original line number Diff line number Diff line
@@ -4099,8 +4099,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) {
@@ -4118,7 +4118,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;
                    }
                }
            }
@@ -4142,8 +4145,10 @@ void MediaCodec::onMessageReceived(const sp<AMessage> &msg) {
            }

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