summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-29 15:50:09 +0200
committerwm4 <wm4@nowhere>2015-05-29 15:50:09 +0200
commit327b091909e713c2c53a45c2868ed6ae0e70a533 (patch)
treee1aa4261f2c67f9a480693a4cdf274713b1907b5
parent9fe6a8c5f54ad89b962e3d88c641b352308beacd (diff)
downloadmpv-327b091909e713c2c53a45c2868ed6ae0e70a533.tar.bz2
mpv-327b091909e713c2c53a45c2868ed6ae0e70a533.tar.xz
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.
-rw-r--r--DOCS/man/lua.rst2
-rw-r--r--player/lua/options.lua7
-rw-r--r--player/lua/osc.lua2
3 files changed, 8 insertions, 3 deletions
diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst
index d5c9b31808..db4957addc 100644
--- a/DOCS/man/lua.rst
+++ b/DOCS/man/lua.rst
@@ -519,7 +519,7 @@ Example implementation::
optionC = true,
}
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
diff --git a/player/lua/options.lua b/player/lua/options.lua
index 087e31b6ef..dd76f7ace7 100644
--- a/player/lua/options.lua
+++ b/player/lua/options.lua
@@ -30,7 +30,7 @@ local function typeconv(desttypeval, val)
end
-function read_options(options, identifier)
+local function read_options(options, identifier)
if identifier == nil then
identifier = mp.get_script_name()
end
@@ -101,4 +101,9 @@ function read_options(options, identifier)
end
+-- backwards compatibility with broken read_options export
+_G.read_options = read_options
+return {
+ read_options = read_options,
+}
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index 2064ba7e47..4e373da74b 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -33,7 +33,7 @@ local user_opts = {
}
-- 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()
playresy = 0, -- canvas size Y