altoslib: Record time_change in AltosState correctly
authorKeith Packard <keithp@keithp.com>
Fri, 6 Sep 2013 05:54:02 +0000 (22:54 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 6 Sep 2013 05:54:02 +0000 (22:54 -0700)
time_change is used to make real-time playback work.

Signed-off-by: Keith Packard <keithp@keithp.com>
altoslib/AltosState.java

index dba9bff8084d5db712ea733e537cac6d9005bbe8..422590573459b3829366f6a37dc3e88601bd132d 100644 (file)
@@ -632,7 +632,9 @@ public class AltosState implements Cloneable {
 
                received_time = old.received_time;
                time = old.time;
 
                received_time = old.received_time;
                time = old.time;
-               time_change = 0;
+               time_change = old.time_change;
+               prev_time = old.time;
+               
                tick = old.tick;
                prev_tick = old.tick;
                boost_tick = old.boost_tick;
                tick = old.tick;
                prev_tick = old.tick;
                boost_tick = old.boost_tick;
@@ -779,6 +781,7 @@ public class AltosState implements Cloneable {
                        }
                        tick = new_tick;
                        time = tick / 100.0;
                        }
                        tick = new_tick;
                        time = tick / 100.0;
+                       time_change = time - prev_time;
                }
        }
 
                }
        }