From eec438a6146535e57bf80b7605f2cac08885f3c9 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 15 Dec 2010 14:25:40 +0100 Subject: [PATCH] Fix jitter test in source selection Distance should be compared to square root of variance. --- sources.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources.c b/sources.c index 3dcfc42..346eace 100644 --- a/sources.c +++ b/sources.c @@ -622,7 +622,7 @@ SRC_SelectSource(unsigned long match_addr) variance */ for (i=0; isel_info.variance > min_distance) { + if (sqrt(sources[index]->sel_info.variance) > min_distance) { sel_sources[i] = INVALID_SOURCE; sources[index]->status = SRC_JITTERY; #if 0