diff options
author | Weiyin Jiang <wjiang@codeaurora.org> | 2016-03-03 14:49:36 +0800 |
---|---|---|
committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2016-03-08 04:25:56 -0800 |
commit | 31eefec89b723397bc2bed84d61558d58c6dfc0f (patch) | |
tree | 4ace452fe0e8535f07bb7c5703252b711d90f63a | |
parent | 869f20135122f5da46e4982387737d76fa5f29cb (diff) | |
download | android_hardware_qcom_audio-31eefec89b723397bc2bed84d61558d58c6dfc0f.tar.gz android_hardware_qcom_audio-31eefec89b723397bc2bed84d61558d58c6dfc0f.tar.bz2 android_hardware_qcom_audio-31eefec89b723397bc2bed84d61558d58c6dfc0f.zip |
hal: correct offload tear down check due to sw effect
This is a subsidiary bug fix of the following incomplete one.
- audio: don't allow track offloaded if there's active sw effect
- Change-Id: Idf76374a3fd721eee595a8a9f6197a47a3c25e1c
CRs-Fixed: 984621
Change-Id: I8997f49560550d4174e1146340e0cd4d33957b24
-rw-r--r-- | policy_hal/AudioPolicyManager.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp index f5fc3f24..34527cbe 100644 --- a/policy_hal/AudioPolicyManager.cpp +++ b/policy_hal/AudioPolicyManager.cpp @@ -1625,16 +1625,22 @@ audio_io_handle_t AudioPolicyManagerCustom::getOutputForDevice( // FIXME: We should check the audio session here but we do not have it in this context. // This may prevent offloading in rare situations where effects are left active by apps // in the background. - - if (((flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) == 0) && - !mEffects.isNonOffloadableEffectEnabled()) { - profile = getProfileForDirectOutput(device, - samplingRate, - format, - channelMask, - (audio_output_flags_t)flags); + // + // Supplementary annotation: + // For sake of track offload introduced, we need a rollback for both compress offload + // and track offload use cases. + if ((flags & (AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD|AUDIO_OUTPUT_FLAG_DIRECT_PCM)) && + mEffects.isNonOffloadableEffectEnabled()) { + ALOGD("non offloadable effect is enabled, try with non direct output"); + goto non_direct_output; } + profile = getProfileForDirectOutput(device, + samplingRate, + format, + channelMask, + (audio_output_flags_t)flags); + if (profile != 0) { if (!(flags & AUDIO_OUTPUT_FLAG_DIRECT_PCM) && |