1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-19 05:15:12 +00:00
mpv/TOOLS
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
..
lua scripting: don't observe properties with type nil 2024-01-20 16:09:34 +00:00
mpv-osd-symbols.sfdir osc: use custom symbols for window controls 2019-12-11 13:53:10 -08:00
osxbundle osxbundle: remove mpv-bundle symlink to allow code signing 2023-11-15 23:08:11 +01:00
docutils-wrapper.py TOOLS/docutils-wrapper: handle commands without depfile 2023-03-24 02:18:39 +00:00
dylib-unhell.py osxbundle: resolve relative linked dependency paths 2023-11-15 23:08:11 +01:00
file2string.py TOOLS/{file2string,matroska}: drop unneeded stdout output 2023-10-28 02:39:48 +00:00
gen-osd-font.sh
idet.sh TOOLS/idet: fix some outdated cli syntax 2023-07-06 22:40:51 -05:00
macos-sdk-version.py TOOLS/macos-sdk-version: remove legacy sdk version retrieval 2023-11-10 14:28:39 +01:00
macos-swift-lib-directory.py TOOLS: add macos-swift-lib-directory.py script 2021-11-14 19:13:10 +00:00
matroska.py TOOLS/{file2string,matroska}: drop unneeded stdout output 2023-10-28 02:39:48 +00:00
mpv_identify.sh player/command: remove video-aspect property 2023-08-31 17:37:42 +00:00
osxbundle.py osxbundle: sign bundle with ad-hoc pseudo identity 2023-11-15 23:08:11 +01:00
stats-conv.py *.py: cosmetic changes 2020-02-27 21:36:21 +01:00
umpv TOOLS/umpv: support shell-quotes in $MPV 2023-01-07 13:16:03 +01:00
uncrustify.cfg