summaryrefslogtreecommitdiff
path: root/hal
diff options
context:
space:
mode:
authorWeiyin Jiang <wjiang@codeaurora.org>2020-12-22 14:35:46 +0800
committerGerrit - the friendly Code Review server <code-review@localhost>2020-12-23 19:51:08 -0800
commitd4e8ced33fbadf778459b4eb36d31343f3068a2f (patch)
treecaeed692ab97814f73805299c709bc2218315620 /hal
parent1b271ce17f3b234ed10e720e00926943417dbc8f (diff)
hal: notify input/output streams of snd card status upon request
Notify input and output stream of snd card status only if it's requested. There's no need to notify other irrelevant events. CRs-Fixed: 2842096 Change-Id: I35cc0e2bbf489268b8da5ff2173355ce36eaa037
Diffstat (limited to 'hal')
-rw-r--r--hal/audio_hw.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index f1ff4ef2..3d98f064 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -8705,18 +8705,21 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs)
/* notify adev and input/output streams on the snd card status */
adev_snd_mon_cb((void *)adev, parms);
- list_for_each(node, &adev->active_outputs_list) {
- streams_output_ctxt_t *out_ctxt = node_to_item(node,
- streams_output_ctxt_t,
- list);
- out_snd_mon_cb((void *)out_ctxt->output, parms);
- }
+ ret = str_parms_get_str(parms, "SND_CARD_STATUS", value, sizeof(value));
+ if (ret >= 0) {
+ list_for_each(node, &adev->active_outputs_list) {
+ streams_output_ctxt_t *out_ctxt = node_to_item(node,
+ streams_output_ctxt_t,
+ list);
+ out_snd_mon_cb((void *)out_ctxt->output, parms);
+ }
- list_for_each(node, &adev->active_inputs_list) {
- streams_input_ctxt_t *in_ctxt = node_to_item(node,
- streams_input_ctxt_t,
- list);
- in_snd_mon_cb((void *)in_ctxt->input, parms);
+ list_for_each(node, &adev->active_inputs_list) {
+ streams_input_ctxt_t *in_ctxt = node_to_item(node,
+ streams_input_ctxt_t,
+ list);
+ in_snd_mon_cb((void *)in_ctxt->input, parms);
+ }
}
pthread_mutex_lock(&adev->lock);