From ab8f9be97985e9d548aa1b6f3992cc7c72f45075 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 25 Feb 2022 11:09:19 +0100 Subject: [PATCH] channelmix: recalc channelmix when param changed --- spa/plugins/audioconvert/channelmix.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/spa/plugins/audioconvert/channelmix.c b/spa/plugins/audioconvert/channelmix.c index 58d1e050a..1867410f7 100644 --- a/spa/plugins/audioconvert/channelmix.c +++ b/spa/plugins/audioconvert/channelmix.c @@ -595,13 +595,16 @@ static int channelmix_set_param(struct impl *this, const char *k, const char *s) this->mix.lfe_cutoff = atoi(s); else if (spa_streq(k, "channelmix.disable")) this->props.disabled = spa_atob(s); - return 0; + else + return 0; + return 1; } static int parse_prop_params(struct impl *this, struct spa_pod *params) { struct spa_pod_parser prs; struct spa_pod_frame f; + int changed = 0; spa_pod_parser_pod(&prs, params); if (spa_pod_parser_push_struct(&prs, &f) < 0) @@ -634,9 +637,11 @@ static int parse_prop_params(struct impl *this, struct spa_pod *params) continue; spa_log_info(this->log, "key:'%s' val:'%s'", name, value); - channelmix_set_param(this, name, value); + changed += channelmix_set_param(this, name, value); } - return 0; + if (changed) + channelmix_init(&this->mix); + return changed; } static int apply_props(struct impl *this, const struct spa_pod *param)