mirror of https://github.com/mpv-player/mpv
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 .
This commit is contained in:
parent
2dd2acac89
commit
365b1d4f3d
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue