mpv/options
Dudemanguy 32be72623b 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.
2023-08-26 00:33:00 +00:00
..
m_config.h options: split m_config.c/h 2020-03-13 16:50:27 +01:00
m_config_core.c osdep: rename MP_UNREACHABLE 2021-11-03 15:15:20 +01:00
m_config_core.h options: more pushing code around 2020-03-13 16:50:27 +01:00
m_config_frontend.c options: log profile name if there is no restore data 2022-10-28 15:48:24 +00:00
m_config_frontend.h options: add watch-later-options 2021-07-21 13:19:28 +00:00
m_option.c m_option: change m_option_type_aspect to double 2023-08-09 13:51:28 +00:00
m_option.h player: make all autoload extensions configurable 2023-08-26 00:33:00 +00:00
m_property.c options: change parameter that was forgottin in property transition 2023-02-27 11:21:49 +01:00
m_property.h options: change parameter that was forgottin in property transition 2023-02-27 11:21:49 +01:00
options.c player: make all autoload extensions configurable 2023-08-26 00:33:00 +00:00
options.h player: make all autoload extensions configurable 2023-08-26 00:33:00 +00:00
parse_commandline.c player: add playlist-path properties 2023-08-13 19:58:20 +00:00
parse_commandline.h player: get rid of mpv_global.opts 2018-05-24 19:56:35 +02:00
parse_configfile.c options: read config file as stream 2023-04-29 22:34:54 +00:00
parse_configfile.h options: read config file as stream 2023-04-29 22:34:54 +00:00
path.c path: handle URLs consistently in mp_basename 2023-06-01 22:47:48 +02:00
path.h path: expand internal path selection API to allow for additional types 2023-05-09 20:37:17 +00:00