audio: hal: Fix for passthrough playback issue.
-ip handler is getting triggered for dolby passthrough streams
as audio_extn_passthru_is_direct_passthrough() is always returning false
due to incorrect condition check.
-Added valid condition check for checking direct passthorugh.
Change-Id: Ieb0858b18ef7189ada8b263a8842576434902422
diff --git a/hal/audio_extn/passthru.c b/hal/audio_extn/passthru.c
index f70d8ea..f0cae69 100644
--- a/hal/audio_extn/passthru.c
+++ b/hal/audio_extn/passthru.c
@@ -417,22 +417,6 @@
}
-bool audio_extn_passthru_is_direct_passthrough(struct stream_out *out)
-{
- //check passthrough system property
- if (!property_get_bool("audio.offload.passthrough", false)) {
- return false;
- }
-
- if ((out != NULL) &&
- (out->compr_config.codec != NULL) &&
- (out->compr_config.codec->compr_passthr == PASSTHROUGH ||
- out->compr_config.codec->compr_passthr == PASSTHROUGH_IEC61937))
- return true;
- else
- return false;
-}
-
bool audio_extn_passthru_is_passthrough_stream(struct stream_out *out)
{
//check passthrough system property
@@ -467,6 +451,15 @@
return false;
}
+bool audio_extn_passthru_is_direct_passthrough(struct stream_out *out)
+{
+ if (((out != NULL) && audio_extn_passthru_is_passthrough_stream(out)) &&
+ !audio_extn_passthru_is_convert_supported(out->dev, out))
+ return true;
+ else
+ return false;
+}
+
int audio_extn_passthru_get_buffer_size(audio_offload_info_t* info)
{
uint32_t fragment_size = MIN_COMPRESS_PASSTHROUGH_FRAGMENT_SIZE;
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 0eab3e6..c5e0dbe 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -3733,9 +3733,9 @@
}
if (out->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL) {
- /*ADD audio_extn_passthru_is_passthrough_stream(out) check*/
- if ((audio_extn_passthru_is_enabled()) &&
- (!out->is_iec61937_info_available)) {
+ if (audio_extn_passthru_is_enabled() &&
+ !out->is_iec61937_info_available &&
+ audio_extn_passthru_is_passthrough_stream(out)) {
audio_extn_passthru_update_stream_configuration(adev, out,
buffer, bytes);
out->is_iec61937_info_available = true;