summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--player/lua/osc.lua12
1 files changed, 11 insertions, 1 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 4d37d766d3..19f4e9b8c4 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2609,7 +2609,17 @@ function tick()
state.tick_last_time = mp.get_time()
if state.anitype ~= nil then
- request_tick()
+ -- state.anistart can be nil - animation should now start, or it can
+ -- be a timestamp when it started. state.idle has no animation.
+ if not state.idle and
+ (not state.anistart or
+ mp.get_time() < 1 + state.anistart + user_opts.fadeduration/1000)
+ then
+ -- animating or starting, or still within 1s past the deadline
+ request_tick()
+ else
+ kill_animation()
+ end
end
end