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

Commit 3c838360 authored by Houxiang Dai's avatar Houxiang Dai Committed by Dorin Drimus
Browse files

Fix codec2 setParameters before successful configure

Calling setParameters() before a successful configure() can lead to a crash. This can happen as a race condition or after a failed configure().

Test:
DTV/MM stress test pass

Bug: 265064014
Change-Id: Id38f04acf449302d2918d164e9d5e8c1083cc2b3
parent 4a7bb7b4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5621,6 +5621,9 @@ status_t MediaCodec::setParameters(const sp<AMessage> &params) {
}

status_t MediaCodec::onSetParameters(const sp<AMessage> &params) {
    if (mState == UNINITIALIZED || mState == INITIALIZING) {
        return NO_INIT;
    }
    updateLowLatency(params);
    mapFormat(mComponentName, params, nullptr, false);
    updateTunnelPeek(params);