From a5419ea6708ad9ee35ad83b3ba0597eea7e6d55e 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 2d8e25080..d7ab67c13 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; }