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

Commit 5c4dd0d1 authored by Andy Hung's avatar Andy Hung
Browse files

AudioFlinger: update error handling moveEffectChain_l

Remove effect from dstThread before restoring on srcThread.

Test: YT Music with effects, legacy USB Hal,
      plug and unplug headset.
Bug: 202360137
Change-Id: Ib83dd838f177b3905b2ae29f2deea1c56bf85de0
parent cdd7a4c2
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -4121,6 +4121,8 @@ status_t AudioFlinger::moveEffectChain_l(audio_session_t sessionId,
    size_t restored = 0;
    if (status != NO_ERROR) {
        for (const auto& effect : removed) {
            dstThread->removeEffect_l(effect); // Note: Depending on error location, the last
                                               // effect may not have been placed on dstThread.
            if (srcThread->addEffect_l(effect) == NO_ERROR) {
                ++restored;
            }