mirror of https://github.com/mpv-player/mpv
osc: react to script-opts runtime changes
With special attention to changing osc-visibility. Untested, although osc-visibility works (it's pretty much equivalent to the key binding, so there is not much interesting going on). Somewhat inspired by code posted by github user CogentRedTester. Fixes: #4513
This commit is contained in:
parent
478a321dcc
commit
b439588172
|
@ -50,7 +50,7 @@ local user_opts = {
|
||||||
}
|
}
|
||||||
|
|
||||||
-- read options from config and command-line
|
-- read options from config and command-line
|
||||||
opt.read_options(user_opts, "osc")
|
opt.read_options(user_opts, "osc", function(list) update_options(list) end)
|
||||||
|
|
||||||
local osc_param = { -- calculated by osc_init()
|
local osc_param = { -- calculated by osc_init()
|
||||||
playresy = 0, -- canvas size Y
|
playresy = 0, -- canvas size Y
|
||||||
|
@ -1639,6 +1639,13 @@ function validate_user_opts()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function update_options(list)
|
||||||
|
validate_user_opts()
|
||||||
|
request_tick()
|
||||||
|
if list["visibility"] then
|
||||||
|
visibility_mode(user_opts.visibility, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- OSC INIT
|
-- OSC INIT
|
||||||
function osc_init()
|
function osc_init()
|
||||||
|
|
Loading…
Reference in New Issue