summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorAvi Halachmi (:avih) <avihpit@yahoo.com>2017-09-20 05:53:10 +0300
committeravih <avih@users.noreply.github.com>2017-09-23 14:41:17 +0300
commit365b1d4f3d3f3d521002aeb9c4c91c1df1cf0814 (patch)
tree195d746b58320416dfeff8b0baa014d4d2a58de2 /player
parent2dd2acac897d4fdf201b98f666cfc9bc13cfa33e (diff)
downloadmpv-365b1d4f3d3f3d521002aeb9c4c91c1df1cf0814.tar.bz2
mpv-365b1d4f3d3f3d521002aeb9c4c91c1df1cf0814.tar.xz
osc: fix rare stack overflow when changing visibility mode
Under some conditions, hide_osc() was calling render(), which then called hide_osc() again, and so forth, until the stack overflows. Tracking the exact conditions where this happens (and then managing them to prevent it) is an excercise in futility. Remove the osc directly - instead of going through the entire rendering procedure just to end up rendering nothing. Fixes #4900 .
Diffstat (limited to 'player')
-rw-r--r--player/lua/osc.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index e4faf6c0cc..cc0e0d0461 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -1894,7 +1894,7 @@ function hide_osc()
-- no-op and won't render again to remove the osc, so do that manually.
state.osc_visible = false
timer_stop()
- render() -- state.osc_visible == false -> remove the osc from screen
+ render_wipe()
elseif (user_opts.fadeduration > 0) then
if not(state.osc_visible == false) then
state.anitype = "out"
@@ -1973,6 +1973,11 @@ function request_init()
state.initREQ = true
end
+function render_wipe()
+ msg.debug("render_wipe()")
+ mp.set_osd_ass(0, 0, "{}")
+end
+
function render()
msg.debug("rendering")
local current_screen_sizeX, current_screen_sizeY, aspect = mp.get_osd_size()