From e7aa15e4756a72dfc00e9edbbc9fb9010cac755b Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 15 Feb 2021 15:39:39 +0100 Subject: [PATCH] audioadapter: only check port params when changed --- spa/plugins/audioconvert/audioadapter.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/spa/plugins/audioconvert/audioadapter.c b/spa/plugins/audioconvert/audioadapter.c index 6d020cb31..c93265bc5 100644 --- a/spa/plugins/audioconvert/audioadapter.c +++ b/spa/plugins/audioconvert/audioadapter.c @@ -651,17 +651,19 @@ static void follower_port_info(void *data, struct impl *this = data; uint32_t i; - for (i = 0; i < info->n_params; i++) { - uint32_t idx = SPA_ID_INVALID; + if (info->change_mask & SPA_PORT_CHANGE_MASK_PARAMS) { + for (i = 0; i < info->n_params; i++) { + uint32_t idx = SPA_ID_INVALID; - switch (info->params[i].id) { - case SPA_PARAM_Format: - idx = 3; - break; - } - if (idx != SPA_ID_INVALID) { - this->params[idx] = info->params[i]; - this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS; + switch (info->params[i].id) { + case SPA_PARAM_Format: + idx = 3; + break; + } + if (idx != SPA_ID_INVALID) { + this->params[idx] = info->params[i]; + this->info.change_mask |= SPA_NODE_CHANGE_MASK_PARAMS; + } } } if (!this->add_listener)