hal: Limit pass-through sample rate to 192k for TrueHD and EC3

Limit pass-through sample rate to 192k for TrueHD and EC3.
192k is the highest sample rate supported by these formats
and both formats multiply the input sample rate by four
which may exceed the maximum supported.

Change-Id: I7f3516c24fdae18b3fb4cf53aa6e7c4c34eaed18
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 660bd6b..38cfe35 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -916,10 +916,13 @@
             (usecase->stream.out->format == AUDIO_FORMAT_E_AC3_JOC) ||
             (usecase->stream.out->format == AUDIO_FORMAT_DOLBY_TRUEHD))
             && audio_extn_passthru_is_passthrough_stream(usecase->stream.out)) {
-            app_type_cfg[len++] = sample_rate * 4;
-        } else {
-            app_type_cfg[len++] = sample_rate;
+
+            sample_rate = sample_rate * 4;
+            if (sample_rate > HDMI_PASSTHROUGH_MAX_SAMPLE_RATE)
+                sample_rate = HDMI_PASSTHROUGH_MAX_SAMPLE_RATE;
         }
+        app_type_cfg[len++] = sample_rate;
+
         if (snd_device_be_idx > 0)
             app_type_cfg[len++] = snd_device_be_idx;