mirror of
https://github.com/mpv-player/mpv
synced 2025-04-20 14:16:36 +00:00
lua: fix options submodule
It polluted the global namespace, instead of exporting the function properly. For now, keep it compatible by explicitly keeping the bogus export. Also fix a mistake in the manpage example.
This commit is contained in:
parent
9fe6a8c5f5
commit
327b091909
@ -519,7 +519,7 @@ Example implementation::
|
|||||||
optionC = true,
|
optionC = true,
|
||||||
}
|
}
|
||||||
read_options(options, "myscript")
|
read_options(options, "myscript")
|
||||||
print(option.optionA)
|
print(options.optionA)
|
||||||
|
|
||||||
|
|
||||||
The config file will be stored in ``lua-settings/identifier.conf`` in mpv's user
|
The config file will be stored in ``lua-settings/identifier.conf`` in mpv's user
|
||||||
|
@ -30,7 +30,7 @@ local function typeconv(desttypeval, val)
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function read_options(options, identifier)
|
local function read_options(options, identifier)
|
||||||
if identifier == nil then
|
if identifier == nil then
|
||||||
identifier = mp.get_script_name()
|
identifier = mp.get_script_name()
|
||||||
end
|
end
|
||||||
@ -101,4 +101,9 @@ function read_options(options, identifier)
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- backwards compatibility with broken read_options export
|
||||||
|
_G.read_options = read_options
|
||||||
|
|
||||||
|
return {
|
||||||
|
read_options = read_options,
|
||||||
|
}
|
||||||
|
@ -33,7 +33,7 @@ local user_opts = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
-- read options from config and command-line
|
-- read options from config and command-line
|
||||||
read_options(user_opts, "osc")
|
opt.read_options(user_opts, "osc")
|
||||||
|
|
||||||
local osc_param = { -- calculated by osc_init()
|
local osc_param = { -- calculated by osc_init()
|
||||||
playresy = 0, -- canvas size Y
|
playresy = 0, -- canvas size Y
|
||||||
|
Loading…
Reference in New Issue
Block a user