audioconvert: fix the filter-graph samplerate

The filter graph runs before or after the resampler depending on the
direction of the conversion.
This commit is contained in:
Wim Taymans 2025-03-14 10:03:44 +01:00
parent d58d2a2375
commit fb43eb8ee2

View file

@ -1000,13 +1000,13 @@ static int setup_filter_graph(struct impl *this, struct spa_filter_graph *graph)
{ {
int res; int res;
char rate_str[64]; char rate_str[64];
struct dir *in; struct dir *dir;
if (graph == NULL) if (graph == NULL)
return 0; return 0;
in = &this->dir[SPA_DIRECTION_INPUT]; dir = &this->dir[SPA_DIRECTION_REVERSE(this->direction)];
snprintf(rate_str, sizeof(rate_str), "%d", in->format.info.raw.rate); snprintf(rate_str, sizeof(rate_str), "%d", dir->format.info.raw.rate);
spa_filter_graph_deactivate(graph); spa_filter_graph_deactivate(graph);
res = spa_filter_graph_activate(graph, res = spa_filter_graph_activate(graph,