aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 812688a..2671a21 100644
--- a/src/main.c
+++ b/src/main.c
@@ -546,6 +546,12 @@ int main(int argc, char** argv)
* passed */
if(view.playing) {
unsigned int dt = current_time - last_time;
+ /* We cap the delta-time to 100 ms so that if imv is asleep for several
+ * seconds or more (e.g. suspended), upon waking up it doesn't try to
+ * catch up all the time it missed by playing through the gif quickly. */
+ if(dt > 100) {
+ dt = 100;
+ }
imv_loader_time_passed(&ldr, dt / 1000.0);
}