From 14f5c097303807fa9f63560089f3d96fc330121f Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 10 Nov 2017 18:23:26 +0100 Subject: [PATCH] Fix an issue where we'd count jitter history from the wrong side. Would not only give horribly wrong results, but also consume tons of CPU power. --- mixer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mixer.cpp b/mixer.cpp index dc178db..4deba02 100644 --- a/mixer.cpp +++ b/mixer.cpp @@ -239,7 +239,7 @@ double JitterHistory::estimate_max_jitter() const if (percentile <= 0.5) { return *next(orders.begin(), elem_idx) * multiplier; } else { - return *prev(orders.end(), elem_idx + 1) * multiplier; + return *prev(orders.end(), orders.size() - elem_idx) * multiplier; } } -- 2.39.2