From 43116be1224bd48316e37525dfd438a3b77a93e4 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 8 Jun 2015 17:22:01 +0200 Subject: [PATCH] smooth: fix resetting --- smooth.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/smooth.c b/smooth.c index e5c60f4..519b2ba 100644 --- a/smooth.c +++ b/smooth.c @@ -266,13 +266,17 @@ SMT_GetOffset(struct timeval *now) void SMT_Reset(struct timeval *now) { + int i; + if (!enabled) return; - locked = 1; smooth_offset = 0.0; smooth_freq = 0.0; last_update = *now; + + for (i = 0; i < NUM_STAGES; i++) + stages[i].wander = stages[i].length = 0.0; } void