From 76619eaa1d5f8830d483c92f55f07737b71aaaea Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 14 Mar 2025 10:03:44 +0100 Subject: [PATCH] audioconvert: fix the filter-graph samplerate The filter graph runs before or after the resampler depending on the direction of the conversion. --- spa/plugins/audioconvert/audioconvert.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/spa/plugins/audioconvert/audioconvert.c b/spa/plugins/audioconvert/audioconvert.c index a244294e6..a18e08629 100644 --- a/spa/plugins/audioconvert/audioconvert.c +++ b/spa/plugins/audioconvert/audioconvert.c @@ -1000,13 +1000,13 @@ static int setup_filter_graph(struct impl *this, struct spa_filter_graph *graph) { int res; char rate_str[64]; - struct dir *in; + struct dir *dir; if (graph == NULL) return 0; - in = &this->dir[SPA_DIRECTION_INPUT]; - snprintf(rate_str, sizeof(rate_str), "%d", in->format.info.raw.rate); + dir = &this->dir[SPA_DIRECTION_REVERSE(this->direction)]; + snprintf(rate_str, sizeof(rate_str), "%d", dir->format.info.raw.rate); spa_filter_graph_deactivate(graph); res = spa_filter_graph_activate(graph,