mpv/DOCS/man
Guido Cella de0849404b scripting: don't observe properties with type nil
mp.observe_property('foo', nil, ...) calls the handler at least 2 times
on each playlist change even when the property doesn't change. This is
dangerous because if you haven't read observe_property's documentation
in a long time this is easy to forget, and you can end up using it for
handlers that are computationally expensive or that cause unintended
side effects.

Therefore, this commit discourages its use more explicitly in the
documentation, and replaces its usages in scripts.

For console.lua, observing focused with type nil leads to calling
mp.osd_message('') when changing file while playing in the terminal with
the console disabled. I don't notice issues from this, but it's safer to
avoid it.

For playlist and track-list this doesn't really matter since they
trigger multiple changes on each new file anyway, but changing it can
avoid encouraging people to imitate the code.

One usage of none in stats.lua is kept because according to b9084dfd47
it is a hack to replicate the deprecated tick event.
2024-01-20 16:09:34 +00:00
..
af.rst m_option: drop support for -del for list options 2023-10-30 16:47:44 +00:00
ao.rst DOCS/ao: change wrong note on which driver is preferred 2024-01-01 22:41:38 +01:00
changes.rst manpage: directly link interface-changes.rst in changelog section 2020-02-21 14:34:02 +01:00
console.rst console.lua: implement case-insensitive completion 2023-12-15 15:44:48 +00:00
encode.rst options: remove a few options marked with .deprecation_message 2023-09-21 16:06:29 +00:00
input.rst DOCS/man: use the correct directive type for "Warning" admonitions 2023-12-28 21:54:09 +01:00
ipc.rst DOCS: Add missing 'not' 2023-01-28 11:59:59 -05:00
javascript.rst scripting: add mp.input 2024-01-13 02:53:08 +00:00
libmpv.rst cplugin: allow loading mpv_* symbols dynamically 2023-09-20 02:16:45 +00:00
lua.rst scripting: don't observe properties with type nil 2024-01-20 16:09:34 +00:00
mpv.rst DOCS/mpv: the playback position is not remembered after poweroff 2024-01-13 10:45:35 +01:00
options.rst DOCS: reorder --volume-max documentation to where --volume is 2024-01-20 16:08:33 +00:00
osc.rst osc: allow disabling special mouse wheel behavior 2023-12-21 09:13:11 +01:00
stats.rst javascript: use --js-memory-report option instead of MPV_LEAK_REPORT 2023-10-26 16:49:56 +00:00
vf.rst m_option: drop support for -del for list options 2023-10-30 16:47:44 +00:00
vo.rst drm: remove selecting the card number with --drm-connector 2023-09-21 16:06:29 +00:00