diff options
author | Luca Stefani <luca020400@lineageos.org> | 2017-05-14 09:41:54 +0200 |
---|---|---|
committer | Luca Stefani <luca020400@lineageos.org> | 2017-05-14 09:41:58 +0200 |
commit | 6e8e9c5470bd1444084a8f832821c12fdc115442 (patch) | |
tree | 59180cca6d189f6892b2d080692c7a57fc33c144 | |
parent | 23be04d0fa9a60d1d5f18d7f1af7510d29ba92e9 (diff) | |
parent | a3818891eca3870076a69ad49aca83a64c5fb34a (diff) | |
download | hardware_qcom_audio-6e8e9c5470bd1444084a8f832821c12fdc115442.tar.gz hardware_qcom_audio-6e8e9c5470bd1444084a8f832821c12fdc115442.tar.bz2 hardware_qcom_audio-6e8e9c5470bd1444084a8f832821c12fdc115442.zip |
Merge tag 'LA.UM.5.5.r1-04600-8x96.0' into HEAD
"LA.UM.5.5.r1-04600-8x96.0"
Change-Id: I85157660a96eed89463489505fa5846796628acf
-rw-r--r-- | policy_hal/AudioPolicyManager.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp index c715fcc4..1e8114f0 100644 --- a/policy_hal/AudioPolicyManager.cpp +++ b/policy_hal/AudioPolicyManager.cpp @@ -1129,8 +1129,10 @@ status_t AudioPolicyManagerCustom::startSource(sp<AudioOutputDescriptor> outputD beaconMuteLatency = handleEventForBeacon(STARTING_OUTPUT); } + // force device change if the output is inactive and no audio patch is already present. // check active before incrementing usage count - bool force = !outputDesc->isActive(); + bool force = !outputDesc->isActive() && + (outputDesc->getPatchHandle() == AUDIO_PATCH_HANDLE_NONE); // increment usage count for this stream on the requested output: // NOTE that the usage count is the same for duplicated output and hardware output which is @@ -1150,12 +1152,17 @@ status_t AudioPolicyManagerCustom::startSource(sp<AudioOutputDescriptor> outputD for (size_t i = 0; i < mOutputs.size(); i++) { sp<AudioOutputDescriptor> desc = mOutputs.valueAt(i); if (desc != outputDesc) { - // force a device change if any other output is managed by the same hw - // module and has a current device selection that differs from selected device. + // force a device change if any other output is: + // - managed by the same hw module + // - has a current device selection that differs from selected device. + // - supports currently selected device + // - has an active audio patch // In this case, the audio HAL must receive the new device selection so that it can // change the device currently selected by the other active output. if (outputDesc->sharesHwModuleWith(desc) && - desc->device() != device) { + desc->device() != device && + desc->supportedDevices() & device && + desc->getPatchHandle() != AUDIO_PATCH_HANDLE_NONE) { force = true; } // wait for audio on other active outputs to be presented when starting |