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

Commit 0ebd300f authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "AudioPolicyManager: Do not allow secondary outputs with PCM offload"...

Merge "AudioPolicyManager: Do not allow secondary outputs with PCM offload" into main am: 55dfef53

Original change: https://android-review.googlesource.com/c/platform/frameworks/av/+/3266746



Change-Id: I41e4785e0fb0d49ba1f9bae71092b8c08965a57e
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 9ef527d4 55dfef53
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -1250,7 +1250,8 @@ status_t AudioPolicyManager::getOutputForAttrInt(

    // FIXME: in case of RENDER policy, the output capabilities should be checked
    if ((secondaryMixes != nullptr && !secondaryMixes->empty())
            && !audio_is_linear_pcm(config->format)) {
            && (!audio_is_linear_pcm(config->format) ||
                    *flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD)) {
        ALOGD("%s: rejecting request as secondary mixes only support pcm", __func__);
        return BAD_VALUE;
    }
@@ -7420,7 +7421,8 @@ void AudioPolicyManager::checkSecondaryOutputs() {
                    client->getSecondaryOutputs().begin(),
                    client->getSecondaryOutputs().end(),
                    secondaryDescs.begin(), secondaryDescs.end())) {
                if (!audio_is_linear_pcm(client->config().format)) {
                if (client->flags() & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD
                        || !audio_is_linear_pcm(client->config().format)) {
                    // If the format is not PCM, the tracks should be invalidated to get correct
                    // behavior when the secondary output is changed.
                    clientsToInvalidate.push_back(client->portId());