From c0c439ff764836741aa319d09fee256fe239f24e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 1 Oct 2020 13:17:09 +0200 Subject: [PATCH] acp: avoid profile switch to the current profile --- spa/plugins/alsa/acp/acp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spa/plugins/alsa/acp/acp.c b/spa/plugins/alsa/acp/acp.c index a4c200b60..d2b3bde9b 100644 --- a/spa/plugins/alsa/acp/acp.c +++ b/spa/plugins/alsa/acp/acp.c @@ -1056,6 +1056,11 @@ int acp_card_set_profile(struct acp_card *card, uint32_t new_index) op = old_index != ACP_INVALID_INDEX ? (pa_alsa_profile*)profiles[old_index] : NULL; np = (pa_alsa_profile*)profiles[new_index]; + if (op == np) + return 0; + + pa_log_info("activate profile: %s (%d)", np->profile.name, new_index); + if (op && op->output_mappings) { PA_IDXSET_FOREACH(am, op->output_mappings, idx) { if (np->output_mappings && @@ -1100,8 +1105,6 @@ int acp_card_set_profile(struct acp_card *card, uint32_t new_index) np->profile.flags |= ACP_PROFILE_ACTIVE; impl->card.active_profile_index = new_index; - pa_log_info("active_profile: %s (%d)", np->profile.name, new_index); - if (impl->events && impl->events->profile_changed) impl->events->profile_changed(impl->user_data, old_index, new_index);