summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortorque <torque@1>2015-08-27 17:15:35 -0700
committerwm4 <wm4@nowhere>2015-08-28 09:49:52 +0200
commitef5f4b4d9ac69abe139e47e132c0c36743a8780a (patch)
treee7580170e2b875fae6f00d23767b9b890b54df2b
parentc61675320b6f04684677e7064b0d6e38f6b23547 (diff)
downloadmpv-ef5f4b4d9ac69abe139e47e132c0c36743a8780a.tar.bz2
mpv-ef5f4b4d9ac69abe139e47e132c0c36743a8780a.tar.xz
osc: exit tick immediately if disabled.
Even after it has been disabled with the `disable-osc` message, the OSC continues to run the tick function. Completely preventing tick from being called is impractical since there are several different places that it's called in the code, so just make it immediately return if the OSC has been disabled. This prevents the OSC from continuing the clear the OSD on every tick, allowing other scripts to disable it so that they may draw to the OSD.
-rw-r--r--player/lua/osc.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 3301df3f36..7ae7fd0a3e 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -1895,6 +1895,8 @@ end
-- called by mpv on every frame
function tick()
+ if (not state.enabled) then return end
+
if (state.idle) then
-- render idle message