hal: Ensure that sample rate is not set to a2dp rate
- HAL when tries to capture with HDMI device, sets sample
rate specific to a2dp dec.
- Add proper check to avoid assigning ad2p dec sample rate
for other devices.
Change-Id: I6f3d0214193ea36ded93191363b6f2d2ffa700b4
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 501421c..1bf5d17 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -1073,7 +1073,7 @@
} else {
audio_extn_btsco_get_sample_rate(snd_device, &usecase->stream.in->app_type_cfg.sample_rate);
}
- if (usecase->stream.in->device & AUDIO_DEVICE_IN_BLUETOOTH_A2DP) {
+ if (usecase->stream.in->device & AUDIO_DEVICE_IN_BLUETOOTH_A2DP & ~AUDIO_DEVICE_BIT_IN) {
audio_extn_a2dp_get_dec_sample_rate(&usecase->stream.in->app_type_cfg.sample_rate);
ALOGI("%s using %d sample rate rate for A2DP dec CoPP",
__func__, usecase->stream.in->app_type_cfg.sample_rate);