From ed5c43204bdad6ad887d1850b2af291ca076f5f0 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Tue, 15 Aug 2017 10:03:29 +0200 Subject: [PATCH] smooth: don't adjust invalid time of last update --- smooth.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/smooth.c b/smooth.c index a035adc..a21dcd8 100644 --- a/smooth.c +++ b/smooth.c @@ -246,7 +246,8 @@ handle_slew(struct timespec *raw, struct timespec *cooked, double dfreq, update_smoothing(cooked, doffset, dfreq); } - UTI_AdjustTimespec(&last_update, cooked, &last_update, &delta, dfreq, doffset); + if (!UTI_IsZeroTimespec(&last_update)) + UTI_AdjustTimespec(&last_update, cooked, &last_update, &delta, dfreq, doffset); } void SMT_Initialise(void) @@ -264,6 +265,8 @@ void SMT_Initialise(void) max_freq *= 1e-6; max_wander *= 1e-6; + UTI_ZeroTimespec(&last_update); + LCL_AddParameterChangeHandler(handle_slew, NULL); }