From 1f578e858c019fef101da2dced44ce703152d8d3 Mon Sep 17 00:00:00 2001 From: Dimitrios Katsaros Date: Fri, 16 Feb 2024 13:45:31 +0100 Subject: [PATCH] resampler: Only use copy when rate is 1.0 The rate we get from dlls can have a subsample precision. However, the check for using process_copy is in sample precision. This means that an adaptive stream will oscillate rather then lock into the exact rate. --- spa/plugins/audioconvert/resample-native.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/audioconvert/resample-native.c b/spa/plugins/audioconvert/resample-native.c index 0906535d2..6c852dd32 100644 --- a/spa/plugins/audioconvert/resample-native.c +++ b/spa/plugins/audioconvert/resample-native.c @@ -157,7 +157,7 @@ static void impl_native_update_rate(struct resample *r, double rate) data->inc = data->in_rate / data->out_rate; data->frac = data->in_rate % data->out_rate; - if (data->in_rate == data->out_rate) { + if (data->in_rate == data->out_rate && rate == 1.0) { data->func = data->info->process_copy; r->func_name = data->info->copy_name; }