From 98b6469b88ecafc4b32a47625a5dabd1f9673ed4 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 11 Feb 2025 11:58:55 +0100 Subject: [PATCH] audioconvert: handle rate_scale in both directions We need to take the direction of the conversion into account when deciding if we should apply rate scaling. --- spa/plugins/audioconvert/audioconvert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index b891d003d..47859e654 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -2165,7 +2165,7 @@ static uint32_t resample_update_rate_match(struct impl *this, bool passthrough, match_size = size; } else { /* Only apply rate_scale if we're working in DSP mode (i.e. in driver rate) */ - double scale = this->dir[SPA_DIRECTION_OUTPUT].mode == SPA_PARAM_PORT_CONFIG_MODE_dsp ? + double scale = this->dir[SPA_DIRECTION_REVERSE(this->direction)].mode == SPA_PARAM_PORT_CONFIG_MODE_dsp ? this->rate_scale : 1.0; double rate = scale / this->props.rate; double fdelay;