summaryrefslogtreecommitdiff
authorLianlian Zhu <lianlian.zhu@amlogic.com>2017-12-15 09:16:29 (GMT)
committer Lianlian Zhu <lianlian.zhu@amlogic.com>2017-12-18 02:43:58 (GMT)
commitf4ff81615e064880b06c9bbcb9468060fa65e56e (patch)
treedd1e3134af40c35ddf0c04a586a990d8b269ef09
parent54da0156376a2d9ddf31042f0ac06d03fec73d3d (diff)
downloadaudio-f4ff81615e064880b06c9bbcb9468060fa65e56e.zip
audio-f4ff81615e064880b06c9bbcb9468060fa65e56e.tar.gz
audio-f4ff81615e064880b06c9bbcb9468060fa65e56e.tar.bz2
audio: solve passthrough fail when hdmi connect and disconnct[1/1]
PD# 155057 when hdmi connect event,audio hw should not return 4 Change-Id: Iabed867a5264dea184e590ebbd9e8a973e3e070c
Diffstat
-rw-r--r--audio_hw.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/audio_hw.c b/audio_hw.c
index fcb4fa9..1894eb2 100644
--- a/audio_hw.c
+++ b/audio_hw.c
@@ -3585,6 +3585,21 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
adev->low_power = true;
}
}
+ if (ret > 0 || (strlen(kvpairs) == 0)) {
+ ALOGI("Amlogic_HAL - %s: return 0 instead of length of data be copied.", __FUNCTION__);
+ str_parms_destroy(parms);
+ ret = 0;
+ return ret;
+ }
+ int val;
+ ret = str_parms_get_str(parms, "connect", value, sizeof(value));
+ if (ret >= 0) {
+ val = atoi(value);
+ if (val & AUDIO_DEVICE_OUT_HDMI) {
+ ALOGI("hdmi connected !");
+ }
+ }
+
str_parms_destroy(parms);
// VTS regards 0 as success, so if we setting parameter successfully,