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

Commit 5d258a4b authored by Houxiang Dai's avatar Houxiang Dai Committed by Harris Dai
Browse files

Refactor MediaCodec restart flow

Play Netflix then play DTV in stress test.
It will configure then setCallback if restart in MediaCodec.
The MediaCodec block mode will check callback when configuring.
At this time, the callback have not been set.

Test: Play Netflix and DTV stress test OK.

Bug: 302481159
Change-Id: I155e16ddbebc81b327cb8bccb118e45f87b27bee
parent e18a6cb5
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -2991,12 +2991,6 @@ status_t MediaCodec::start() {
                ALOGE("retrying start: failed to reset codec");
                break;
            }
            sp<AMessage> response;
            err = PostAndAwaitResponse(mConfigureMsg, &response);
            if (err != OK) {
                ALOGE("retrying start: failed to configure codec");
                break;
            }
            if (callback != nullptr) {
                err = setCallback(callback);
                if (err != OK) {
@@ -3005,6 +2999,12 @@ status_t MediaCodec::start() {
                }
                ALOGD("succeed to set callback for reclaim");
            }
            sp<AMessage> response;
            err = PostAndAwaitResponse(mConfigureMsg, &response);
            if (err != OK) {
                ALOGE("retrying start: failed to configure codec");
                break;
            }
        }

        // Keep callback message after the first iteration if necessary.