mpv/DOCS
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
..
man scripting: don't observe properties with type nil 2024-01-20 16:09:34 +00:00
client-api-changes.rst libmpv: add mpv_time_ns() 2023-10-10 19:10:55 +00:00
compatibility.rst
compile-windows.md DOCS/compile-windows.md: update MSYS2 packages 2023-01-28 01:03:12 +00:00
contribute.md various: fix capitalization of 'GitHub' 2023-12-27 22:11:58 +01:00
edl-mpv.rst
encoding.rst DOCS/encoding: remove the legacy option syntax 2022-07-07 21:12:57 -04:00
interface-changes.rst DOCS: add documentation for --volume-gain options 2024-01-20 16:08:33 +00:00
mplayer-changes.rst player/command: remove video-aspect property 2023-08-31 17:37:42 +00:00
release-policy.md DOCS/release-policy.md: add additional advice 2023-07-17 11:55:45 +02:00
tech-overview.txt ALL: use new mp_thread abstraction 2023-11-05 17:36:17 +00:00