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

Commit 949c603e authored by Franois Gaffie's avatar Franois Gaffie Committed by android-build-merger
Browse files

audiopolicy: fix source client lifecycle

am: 5592ee26

Change-Id: I799c2190289f664f0c68c5729dff32d67df1feeb
parents 309963bb 5592ee26
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -3924,6 +3924,8 @@ status_t AudioPolicyManager::connectAudioSource(const sp<SourceClientDescriptor>

        if (status != NO_ERROR) {
            mpClientInterface->releaseAudioPatch(sourceDesc->patchDesc()->mAfPatchHandle, 0);
            outputDesc->removeClient(sourceDesc->portId());
            outputDesc->stop();
            return status;
        }
        sourceDesc->setSwOutput(outputDesc);
@@ -4188,6 +4190,7 @@ status_t AudioPolicyManager::disconnectAudioSource(const sp<SourceClientDescript
        if (status == NO_ERROR) {
            swOutputDesc->stop();
        }
        swOutputDesc->removeClient(sourceDesc->portId());
        mpClientInterface->releaseAudioPatch(patchDesc->mAfPatchHandle, 0);
    } else {
        sp<HwAudioOutputDescriptor> hwOutputDesc = sourceDesc->hwOutput().promote();