From 42aa38f832c370b7619b7604311e045459dc60a7 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Tue, 2 Dec 2008 23:52:23 +0000 Subject: [PATCH] We really need to adjust _priorCurrent regardless of whether this particular call to elapsed() is at a driftRatio of 1.0 or not - the next one might not be, so we need to keep it up to date. Otherwise, we could potentially yank _startStamp around by minutes or hours due to a stale _priorCurrent. git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@726 ed5b42cb-e716-0410-a449-f6a68f950b19 --- src/java/com/threerings/media/timer/CalibratingTimer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/java/com/threerings/media/timer/CalibratingTimer.java b/src/java/com/threerings/media/timer/CalibratingTimer.java index 6fbb686f..b502a0c4 100644 --- a/src/java/com/threerings/media/timer/CalibratingTimer.java +++ b/src/java/com/threerings/media/timer/CalibratingTimer.java @@ -107,8 +107,9 @@ public abstract class CalibratingTimer if (_driftRatio != 1.0) { long elapsed = current - _priorCurrent; _startStamp += (elapsed - (elapsed * _driftRatio)); - _priorCurrent = current; } + _priorCurrent = current; + return current - _startStamp; }