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

Commit d7fbd841 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "AudioPolicy: Fix music stutter when device connect" into main

parents 63dcf979 c42a2025
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -7547,7 +7547,8 @@ void AudioPolicyManager::checkOutputForAttributes(const audio_attributes_t &attr
        }

        for (const sp<TrackClientDescriptor>& client : desc->getClientIterable()) {
            if (mEngine->getProductStrategyForAttributes(client->attributes()) != psId) {
            if (mEngine->getProductStrategyForAttributes(client->attributes()) != psId
                    || client->isInvalid()) {
                continue;
            }
            if (!desc->supportsAllDevices(newDevices)) {
@@ -7584,6 +7585,9 @@ void AudioPolicyManager::checkOutputForAttributes(const audio_attributes_t &attr

            bool invalidate = false;
            for (auto client : desc->clientsList(false /*activeOnly*/)) {
                if (client->isInvalid()) {
                    continue;
                }
                if (desc->isDuplicated() || !desc->mProfile->isDirectOutput()) {
                    // a client on a non direct outputs has necessarily a linear PCM format
                    // so we can call selectOutput() safely