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

Commit c03ada6c authored by Eric Laurent's avatar Eric Laurent
Browse files

Audio policy: fix effect parking when releasing an input

When releasing a record client from an input descriptor,
park effects in the client session only if this client is
the last connected client in this session.

Bug: 330442316
Test: repro steps in the bug
Change-Id: I55c60cb8be8beffe23ded62fcacbe5dc028f3a8f
parent e1804d51
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -3177,7 +3177,12 @@ void AudioPolicyManager::releaseInput(audio_port_handle_t portId)
    ALOGV("%s %d", __FUNCTION__, input);

    inputDesc->removeClient(portId);

    // If no more clients are present in this session, park effects to an orphan chain
    RecordClientVector clientsOnSession = inputDesc->getClientsForSession(client->session());
    if (clientsOnSession.size() == 0) {
        mEffects.putOrphanEffects(client->session(), input, &mInputs, mpClientInterface);
    }
    if (inputDesc->getClientCount() > 0) {
        ALOGV("%s(%d) %zu clients remaining", __func__, portId, inputDesc->getClientCount());
        return;