From 00af718a9e47a6c7a48f821a93f788c22bdd41a7 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sun, 22 Dec 2019 12:30:53 +0100 Subject: lua: change runtime option change behavior As described in the manpage changes. This makes more sense than the previous approach, where options could "unexpectedly" stick. Although this is still a somewhat arbitrary policy (ask many people and you'd get a number of different expectations on what should happen), I think that it reflects what mpv's builtin stuff does. All the copying is annoying, but let's just hope nobody is stupid enough to change these properties per video frame or something equally ridiculous. --- DOCS/man/lua.rst | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'DOCS') diff --git a/DOCS/man/lua.rst b/DOCS/man/lua.rst index 6c6904c8b3..d98edf38a9 100644 --- a/DOCS/man/lua.rst +++ b/DOCS/man/lua.rst @@ -581,6 +581,12 @@ with values found in the config-file and the command-line (in that order). the function) are changed, and ``on_update(list)`` is called. ``list`` is a table where each updated option has a ``list[option_name] = true`` entry. There is no initial ``on_update()`` call. This never re-reads the config file. + ``script-opts`` is always applied on the original config file, ignoring + previous ``script-opts`` values (for example, if an option is removed from + ``script-opts`` at runtime, the option will have the value in the config + file). ``table`` entries are only written for option values whose values + effectively change (this is important if the script changes ``table`` + entries independently). Example implementation:: -- cgit v1.2.3