From fa9efe4828834a62b694232d61124f4b0703d922 Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Thu, 30 Apr 2009 18:47:59 +0100 Subject: [PATCH] Accumulate small deltas The clutter frame source tries to average out the frame deltas so that if one frame takes 1 interval plus a little bit of extra time then the next frame will be 1 interval minus that little bit of extra time. Therefore the deltas can sometimes be less than the frame interval. ClutterTimeline should accumulate these small differences otherwise it will end up missing out frames so the total duration of the timeline will be a lot longer. For example this was causing test-actors to appear to run very slow. --- clutter/clutter-timeline.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clutter/clutter-timeline.c b/clutter/clutter-timeline.c index 9e00070..e21a5ec 100644 --- a/clutter/clutter-timeline.c +++ b/clutter/clutter-timeline.c @@ -1398,7 +1398,9 @@ clutter_timeline_advance_delta (ClutterTimeline *timeline, { clutter_timeline_advance_internal (timeline); - priv->msecs_delta = 0; + /* Keep the remainder of the frame time so that it will be + counted towards the next time if the delta is short */ + priv->msecs_delta %= priv->frame_interval; } } -- 2.7.4