summaryrefslogtreecommitdiffstats
path: root/DOCS/man/options.rst
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2023-08-10 17:36:22 -0500
committerDudemanguy <random342@airmail.cc>2023-08-26 00:33:00 +0000
commit32be72623b1d43027f2d97c15fcf604d8c328e00 (patch)
tree7d58216175bb08fc77ae746d19902194bdbfa43f /DOCS/man/options.rst
parentafdd2fa5656140c55a0b685e498a89a2249a623a (diff)
downloadmpv-32be72623b1d43027f2d97c15fcf604d8c328e00.tar.bz2
mpv-32be72623b1d43027f2d97c15fcf604d8c328e00.tar.xz
player: make all autoload extensions configurable
--audio-file-auto, --cover-art-auto, and --sub-auto all work by using an internally hardcoded list that determine what file extensions get recognized. This is fine and people periodically update it, but we can actually expose this as a stringlist option instead. This way users can add or remove any file extension for any type. For the most part, this is pretty pretty easy and involves making sub_exts, etc. the defaults for the new options (--audio-file-auto-exts, --cover-art-auto-exts, and --sub-auto-exts). There's actually one slight complication however. The input code uses mp_might_be_subtitle_file which guesses if the file drag and dropped file is a subtitle. The input ctx has no access to mpctx so we have to be clever here. For this, the trick is to recognize that we can leverage the m_option_change_callback. We add a new flag, UPDATE_SUB_EXTS, which fires when the player starts up. Then in the callback, we can set the value of sub_exts in external_files to opts->sub_auto_exts. Whenever the option updates, the callback is fired again and sub_exts updates. That way mp_might_be_subtitle_file can just operate off of this global variable instead of trying to mess with the core mpv state directly. Fixes #12000.
Diffstat (limited to 'DOCS/man/options.rst')
-rw-r--r--DOCS/man/options.rst17
1 files changed, 17 insertions, 0 deletions
diff --git a/DOCS/man/options.rst b/DOCS/man/options.rst
index bbdcb7cd6e..23692a672f 100644
--- a/DOCS/man/options.rst
+++ b/DOCS/man/options.rst
@@ -2187,6 +2187,11 @@ Audio
:all: Load all audio files in the current and ``--audio-file-paths``
directories.
+``--audio-file-auto-exts=ext1,ext2,...``
+ Audio file extentions to try and match when using ``audio-file-auto``.
+
+ This is a string list option. See `List Options`_ for details.
+
``--audio-file-paths=<path1:path2:...>``
Equivalent to ``--sub-file-paths`` option, but for auto-loaded audio files.
@@ -2566,6 +2571,13 @@ Subtitles
:fuzzy: Load all subs containing the media filename.
:all: Load all subs in the current and ``--sub-file-paths`` directories.
+``--sub-auto-exts=ext1,ext2,...``
+ Subtitle extentions to try and match when using ``--sub-auto``. Note that
+ modifying this list will also affect what mpv recognizes as subtitles when
+ using drag and drop.
+
+ This is a string list option. See `List Options`_ for details.
+
``--sub-codepage=<codepage>``
You can use this option to specify the subtitle codepage. uchardet will be
used to guess the charset. (If mpv was not compiled with uchardet, then
@@ -7191,6 +7203,11 @@ Miscellaneous
See ``--audio-display`` how to control display of cover art (this can be
used to disable cover art that is part of the file).
+``--cover-art-auto-exts=ext1,ext2,...``
+ Cover art extentions to try and match when using ``cover-art-auto``.
+
+ This is a string list option. See `List Options`_ for details.
+
``--cover-art-whitelist=<no|yes>``
Whether to load filenames in an internal whitelist, such as ``cover.jpg``,
as cover art. If ``cover-art-auto`` is set to ``no``, the whitelisted