From 327b091909e713c2c53a45c2868ed6ae0e70a533 Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 29 May 2015 15:50:09 +0200 Subject: 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. --- player/lua/options.lua | 7 ++++++- player/lua/osc.lua | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'player') 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 -- cgit v1.2.3