mirror of
https://github.com/mpv-player/mpv
synced 2024-12-19 05:15:12 +00:00
de0849404b
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
|
||
---|---|---|
.. | ||
lua | ||
mpv-osd-symbols.sfdir | ||
osxbundle | ||
docutils-wrapper.py | ||
dylib-unhell.py | ||
file2string.py | ||
gen-osd-font.sh | ||
idet.sh | ||
macos-sdk-version.py | ||
macos-swift-lib-directory.py | ||
matroska.py | ||
mpv_identify.sh | ||
osxbundle.py | ||
stats-conv.py | ||
umpv | ||
uncrustify.cfg |