summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPradnya Chaphekar <pradnyac@codeaurora.org>2014-09-02 15:29:38 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2014-09-03 15:42:58 -0700
commitb083e14ebb87aeddbc08a5b7601cb3c95871a427 (patch)
tree28350e35b3f6958441cf277f5da7d42b56a56047
parentdd3de0047f271b2c28ada94641fe131d89ffdd42 (diff)
downloadandroid_hardware_qcom_audio-b083e14ebb87aeddbc08a5b7601cb3c95871a427.tar.gz
android_hardware_qcom_audio-b083e14ebb87aeddbc08a5b7601cb3c95871a427.tar.bz2
android_hardware_qcom_audio-b083e14ebb87aeddbc08a5b7601cb3c95871a427.zip
policy_hal: Return error in getOutput if passthrough is disabled
If client sets passthrough flag when passthrough is disabled in hal, getPassthroughoutput does not return an error resulting in playback with passthrough. Return an error in this case such that the client is forced to recreate track with passthrough disabled. Change-Id: I9744372c0e2cb3f9362000c41d2173516c306c79
-rw-r--r--policy_hal/AudioPolicyManager.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/policy_hal/AudioPolicyManager.cpp b/policy_hal/AudioPolicyManager.cpp
index bef73be7..c7566ad8 100644
--- a/policy_hal/AudioPolicyManager.cpp
+++ b/policy_hal/AudioPolicyManager.cpp
@@ -2094,14 +2094,14 @@ audio_io_handle_t AudioPolicyManager::getPassthroughOutput(
// output. This is required if client sets passthrough flag directly.
bool shouldReturnError = false;
+ if (flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)
+ shouldReturnError = true;
+
if (!isHDMIPassthroughEnabled()) {
ALOGV("getPassthroughOutput: passthrough not enabled");
goto noPassthrough;
}
- if (flags & AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH)
- shouldReturnError = true;
-
// Passthrough used for dolby formats and if device is HDMI
if ((format == AUDIO_FORMAT_EAC3 || format == AUDIO_FORMAT_AC3 ||
format == AUDIO_FORMAT_E_AC3_JOC) &&