summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorossifrage <82336322+ossifrage@users.noreply.github.com>2021-04-24 21:20:15 -0700
committeravih <avih@users.noreply.github.com>2021-04-25 19:24:46 +0300
commitc1568a3a6c61252d5fc003602f00c0264a196822 (patch)
treebb3ab229231c5a639448a413d68d148de97a908f
parentd3b7732aaa3c9c94bee94937c8bb69cddfc09a2d (diff)
downloadmpv-c1568a3a6c61252d5fc003602f00c0264a196822.tar.bz2
mpv-c1568a3a6c61252d5fc003602f00c0264a196822.tar.xz
osc: display immediately when visibility changes from never to always
Clearing state.osd.data with an empty string at render_wipe() fixes an issue where changing the OSC visibility from "never" directly to "always" didn't immediately update the display when the player was paused. This could be verified by starting the player with `--script-opts=osc-visibility=always --pause` and then running `script-message osc-visibility never` followed by `script-message osc-visibility always`. Removing the overlay without changing the contents meant the overlay wouldn't update and display when enabled again until the fields changed in some way (e.g. seeking, mousing over the OSC area, etc.). Clearing state.osd.data before removal of the OSC makes sure set_osd doesn't return on re-enable and instead displays the OSC immediately as the data is now different. render_wipe() is now also used when the OSC needs to be cleared at tick() as using set_osd to clear it with an empty string did not call state.osd:remove() which can allow cleanups related to bitmap memory allocations etc.
-rw-r--r--player/lua/osc.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index af59470335..9e1978bfc3 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2236,6 +2236,7 @@ end
function render_wipe()
msg.trace("render_wipe()")
+ state.osd.data = "" -- allows set_osd to immediately update on enable
state.osd:remove()
end
@@ -2548,7 +2549,7 @@ function tick()
render()
else
-- Flush OSD
- set_osd(osc_param.playresy, osc_param.playresy, "")
+ render_wipe()
end
state.tick_last_time = mp.get_time()