This allows loading other types of media from the current directory,
with same_type=no, regardless of whether the current type is enabled for
autoload.
Fixes: #14287
Fixes:
autoload.lua:201:1: setting undefined field filter of global table
autoload.lua:209:1: setting undefined field append of global table
autoload.lua:322:11: value assigned to variable extensions is unused
Autoload script can now exclude certain files
Why? Sometimes you want to ignore thumbnails,
auto-generated backups or just unwanted files
A non-exhaustive list of real-world examples:
- user backup files: '%.bak%.mp4$' or '^bak-'
- telegram-desktop thumbnails: '_thumb%.jpg$'
- a krita graphics editor backup suffix: '^~'
See documentation here: lua.org/pil/20.2.html
I don't actually deinterlace ever but allegedly this is better than
yadif, and there's no real reason to not have this be the fallback
deinterlace when we're not using hw frames. Also change various mentions
of yadif to bwdif. Ref #12835.
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.
Quickly going through a directory with too many loadable files causes the
autoload tasks to pile up and exiting the player will take forever. Avoid
this by skipping loading when playback is aborted.
This is more stable in practice. Avoids switching between possibly
different hwdecs and avoids unnecessary init. Software decoding should be
more stable and possibly faster overall for decoding this small portion
of video needed for cropdetect.
msg.info for when you're potentially adding hundreds of files is way
too spammy and not really useful (autoload loads files, what?). Bump it
up to msg.verbose. Also bump up the previously existing msg.verbose logs
up to msg.debug to keep the difference in log levels. Fixes#12551.
I didn't set file-local-options/hwdec because you have to store the
hwdec value to restore it after cropdetect anyway, and if the user
manually changes hwdec after cropdetect, the new value isn't reset when
changing file.
If you change file while cropdetect is active and you try to crop the
next video, it fails with "Already cropdetecting!". This is because
timers.detect_crop wasn't cleared correctly, only the timer variable
local to the loop was being set to nil.