mirror of
https://github.com/mpv-player/mpv
synced 2025-04-07 10:02:50 +00:00
options: change everything again
Fucking bullshit.
This commit is contained in:
parent
d24f4587a7
commit
e4bc563fd2
@ -40,12 +40,14 @@ Interface changes
|
|||||||
- the deprecated handling of setting "no-" options via client API is dropped
|
- the deprecated handling of setting "no-" options via client API is dropped
|
||||||
- the following options change to append-by-default (and possibly separator):
|
- the following options change to append-by-default (and possibly separator):
|
||||||
--script
|
--script
|
||||||
--audio-file-paths
|
|
||||||
--sub-paths
|
|
||||||
also, the following options are deprecated:
|
also, the following options are deprecated:
|
||||||
--audio-file-paths => --audio-file-path
|
--sub-paths => --sub-file-paths
|
||||||
--sub-paths => --sub-file-path
|
the following options are deprecated for setting via API:
|
||||||
--opengl-shaders => --opengl-shader
|
"script" (use "scripts")
|
||||||
|
"sub-file" (use "sub-files")
|
||||||
|
"audio-file" (use "audio-files")
|
||||||
|
"external-file" (use "external-files")
|
||||||
|
(the compatibility hacks for this will be removed after this release)
|
||||||
- remove property `vo-performance`, and add `vo-passes` as a more general
|
- remove property `vo-performance`, and add `vo-passes` as a more general
|
||||||
replacement
|
replacement
|
||||||
--- mpv 0.25.0 ---
|
--- mpv 0.25.0 ---
|
||||||
|
@ -429,8 +429,8 @@ Options for filenames do not use ``,`` as separator, but ``:`` (Unix) or ``;``
|
|||||||
============= ===============================================
|
============= ===============================================
|
||||||
Suffix Meaning
|
Suffix Meaning
|
||||||
============= ===============================================
|
============= ===============================================
|
||||||
-add Append 1 or more items
|
-add Append 1 or more items (may become alias for -append)
|
||||||
-add-str Append single item (avoids need for escaping)
|
-append Append single item (avoids need for escaping)
|
||||||
-clr Clear the option
|
-clr Clear the option
|
||||||
-del Delete an existing item by integer index
|
-del Delete an existing item by integer index
|
||||||
-pre Prepend 1 or more items
|
-pre Prepend 1 or more items
|
||||||
@ -442,8 +442,9 @@ this is strongly discouraged and deprecated, except for ``-set``.
|
|||||||
|
|
||||||
Without suffix, the action taken is normally ``-set``.
|
Without suffix, the action taken is normally ``-set``.
|
||||||
|
|
||||||
Some options (like ``--sub-file``, ``--audio-file``, ``--opengl-shader``) append
|
Some options (like ``--sub-file``, ``--audio-file``, ``--opengl-shader``) are
|
||||||
one file per option use. Their default action is ``-add-str``.
|
aliases for the proper option with ``-append`` action. For example,
|
||||||
|
``--sub-file`` is an alias for ``--sub-files-append``.
|
||||||
|
|
||||||
Playing DVDs
|
Playing DVDs
|
||||||
------------
|
------------
|
||||||
|
@ -67,7 +67,7 @@ Track Selection
|
|||||||
stream index is relatively arbitrary, but useful when interacting with
|
stream index is relatively arbitrary, but useful when interacting with
|
||||||
other software using FFmpeg (consider ``ffprobe``).
|
other software using FFmpeg (consider ``ffprobe``).
|
||||||
|
|
||||||
Note that with external tracks (added with ``--sub-file`` and similar
|
Note that with external tracks (added with ``--sub-files`` and similar
|
||||||
options), there will be streams with duplicate IDs. In this case, the
|
options), there will be streams with duplicate IDs. In this case, the
|
||||||
first stream in order is selected.
|
first stream in order is selected.
|
||||||
|
|
||||||
@ -1362,13 +1362,16 @@ Audio
|
|||||||
|
|
||||||
This option has no influence on files with normal video tracks.
|
This option has no influence on files with normal video tracks.
|
||||||
|
|
||||||
``--audio-file=<filename>``
|
``--audio-files=<files>``
|
||||||
Play audio from an external file while viewing a video. Each use of this
|
Play audio from an external file while viewing a video.
|
||||||
option will add a new audio track. The details are similar to how
|
|
||||||
``--sub-file`` works.
|
|
||||||
|
|
||||||
This is a list option. See `List Options`_ for details.
|
This is a list option. See `List Options`_ for details.
|
||||||
|
|
||||||
|
``--audio-file=<file>``
|
||||||
|
CLI/config file only alias for ``--audio-files-append``. Each use of this
|
||||||
|
option will add a new audio track. The details are similar to how
|
||||||
|
``--sub-file`` works.
|
||||||
|
|
||||||
``--audio-format=<format>``
|
``--audio-format=<format>``
|
||||||
Select the sample format used for output from the audio filter layer to
|
Select the sample format used for output from the audio filter layer to
|
||||||
the sound card. The values that ``<format>`` can adopt are listed below in
|
the sound card. The values that ``<format>`` can adopt are listed below in
|
||||||
@ -1439,10 +1442,7 @@ Audio
|
|||||||
directories.
|
directories.
|
||||||
|
|
||||||
``--audio-file-paths=<path1:path2:...>``
|
``--audio-file-paths=<path1:path2:...>``
|
||||||
Deprecated, use ``--audio-file-path``.
|
Equivalent to ``--sub-file-paths`` option, but for auto-loaded audio files.
|
||||||
|
|
||||||
``--audio-file-path=path1>``
|
|
||||||
Equivalent to ``--sub-file-path`` option, but for auto-loaded audio files.
|
|
||||||
|
|
||||||
``--audio-client-name=<name>``
|
``--audio-client-name=<name>``
|
||||||
The application name the player reports to the audio API. Can be useful
|
The application name the player reports to the audio API. Can be useful
|
||||||
@ -1505,7 +1505,7 @@ Subtitles
|
|||||||
``--sub-delay=<sec>``
|
``--sub-delay=<sec>``
|
||||||
Delays subtitles by ``<sec>`` seconds. Can be negative.
|
Delays subtitles by ``<sec>`` seconds. Can be negative.
|
||||||
|
|
||||||
``--sub-file=subtitlefile``
|
``--sub-files=<file-list>``
|
||||||
Add a subtitle file to the list of external subtitles.
|
Add a subtitle file to the list of external subtitles.
|
||||||
|
|
||||||
If you use ``--sub-file`` only once, this subtitle file is displayed by
|
If you use ``--sub-file`` only once, this subtitle file is displayed by
|
||||||
@ -1861,9 +1861,9 @@ Subtitles
|
|||||||
Never applied to text subtitles.
|
Never applied to text subtitles.
|
||||||
|
|
||||||
``--sub-paths=<path1:path2:...>``
|
``--sub-paths=<path1:path2:...>``
|
||||||
Deprecated, use ``--sub-file-path``.
|
Deprecated, use ``--sub-file-paths``.
|
||||||
|
|
||||||
``--sub-file-path=path``
|
``--sub-file-paths=<path-list>``
|
||||||
Specify extra directories to search for subtitles matching the video.
|
Specify extra directories to search for subtitles matching the video.
|
||||||
Multiple directories can be separated by ":" (";" on Windows).
|
Multiple directories can be separated by ":" (";" on Windows).
|
||||||
Paths can be relative or absolute. Relative paths are interpreted relative
|
Paths can be relative or absolute. Relative paths are interpreted relative
|
||||||
@ -1874,7 +1874,7 @@ Subtitles
|
|||||||
.. admonition:: Example
|
.. admonition:: Example
|
||||||
|
|
||||||
Assuming that ``/path/to/video/video.avi`` is played and
|
Assuming that ``/path/to/video/video.avi`` is played and
|
||||||
``--sub-file-path=sub --sub-file-path=subtitles`` is specified, mpv
|
``--sub-file-paths=sub:subtitles`` is specified, mpv
|
||||||
searches for subtitle files in these directories:
|
searches for subtitle files in these directories:
|
||||||
|
|
||||||
- ``/path/to/video/``
|
- ``/path/to/video/``
|
||||||
@ -4167,7 +4167,7 @@ The following video options are currently all specific to ``--vo=opengl`` and
|
|||||||
results, as can missing or incorrect display FPS information (see
|
results, as can missing or incorrect display FPS information (see
|
||||||
``--display-fps``).
|
``--display-fps``).
|
||||||
|
|
||||||
``--opengl-shader=<file>``
|
``--opengl-shaders=<file-list>``
|
||||||
Custom GLSL hooks. These are a flexible way to add custom fragment shaders,
|
Custom GLSL hooks. These are a flexible way to add custom fragment shaders,
|
||||||
which can be injected at almost arbitrary points in the rendering pipeline,
|
which can be injected at almost arbitrary points in the rendering pipeline,
|
||||||
and access all previous intermediate textures. Each use of the option will
|
and access all previous intermediate textures. Each use of the option will
|
||||||
@ -4333,9 +4333,8 @@ The following video options are currently all specific to ``--vo=opengl`` and
|
|||||||
pass. When overwriting a texture marked ``fixed``, the WIDTH, HEIGHT and
|
pass. When overwriting a texture marked ``fixed``, the WIDTH, HEIGHT and
|
||||||
OFFSET must be left at their default values.
|
OFFSET must be left at their default values.
|
||||||
|
|
||||||
``--opengl-shaders=<files>``
|
``--opengl-shader=<file>``
|
||||||
Deprecated option for ``--opengl-shader``. Command line parsing behaves
|
CLI/config file only alias for ``--opengl-shaders-append``.
|
||||||
slightly diffent. ``--opengl-shader-set`` gives exactly the same behavior.
|
|
||||||
|
|
||||||
``--deband``
|
``--deband``
|
||||||
Enable the debanding algorithm. This greatly reduces the amount of visible
|
Enable the debanding algorithm. This greatly reduces the amount of visible
|
||||||
@ -5010,24 +5009,28 @@ Miscellaneous
|
|||||||
for scripts which want to set a title, without overriding the user's
|
for scripts which want to set a title, without overriding the user's
|
||||||
setting in ``--title``.
|
setting in ``--title``.
|
||||||
|
|
||||||
``--external-file=<filename>``
|
``--external-files=<file-list>``
|
||||||
Load a file and add all of its tracks. This is useful to play different
|
Load a file and add all of its tracks. This is useful to play different
|
||||||
files together (for example audio from one file, video from another), or
|
files together (for example audio from one file, video from another), or
|
||||||
for advanced ``--lavfi-complex`` used (like playing two video files at
|
for advanced ``--lavfi-complex`` used (like playing two video files at
|
||||||
the same time).
|
the same time).
|
||||||
|
|
||||||
Unlike ``--sub-file`` and ``--audio-file``, this includes all tracks, and
|
Unlike ``--sub-files`` and ``--audio-files``, this includes all tracks, and
|
||||||
does not cause default stream selection over the "proper" file. This makes
|
does not cause default stream selection over the "proper" file. This makes
|
||||||
it slightly less intrusive.
|
it slightly less intrusive.
|
||||||
|
|
||||||
This is a list option. See `List Options`_ for details.
|
This is a list option. See `List Options`_ for details.
|
||||||
|
|
||||||
|
``--external-file=<file>``
|
||||||
|
CLI/config file only alias for ``--external-files-append``. Each use of this
|
||||||
|
option will add a new external files.
|
||||||
|
|
||||||
``--autoload-files=<yes|no>``
|
``--autoload-files=<yes|no>``
|
||||||
Automatically load/select external files (default: yes).
|
Automatically load/select external files (default: yes).
|
||||||
|
|
||||||
If set to ``no``, then do not automatically load external files as specified
|
If set to ``no``, then do not automatically load external files as specified
|
||||||
by ``--sub-auto`` and ``--audio-file-auto``. If external files are forcibly
|
by ``--sub-auto`` and ``--audio-file-auto``. If external files are forcibly
|
||||||
added (like with ``--sub-file``), they will not be auto-selected.
|
added (like with ``--sub-files``), they will not be auto-selected.
|
||||||
|
|
||||||
This does not affect playlist expansion, redirection, or other loading of
|
This does not affect playlist expansion, redirection, or other loading of
|
||||||
referenced files like with ordered chapters.
|
referenced files like with ordered chapters.
|
||||||
|
@ -566,6 +566,9 @@ struct m_config_option *m_config_get_co(const struct m_config *config,
|
|||||||
co->warning_was_printed = true;
|
co->warning_was_printed = true;
|
||||||
}
|
}
|
||||||
return m_config_get_co(config, bstr0(alias));
|
return m_config_get_co(config, bstr0(alias));
|
||||||
|
} else if (co->opt->type == &m_option_type_cli_alias) {
|
||||||
|
// Pretend it does not exist.
|
||||||
|
return NULL;
|
||||||
} else if (co->opt->type == &m_option_type_removed) {
|
} else if (co->opt->type == &m_option_type_removed) {
|
||||||
if (!co->warning_was_printed) {
|
if (!co->warning_was_printed) {
|
||||||
char *msg = co->opt->priv;
|
char *msg = co->opt->priv;
|
||||||
@ -806,8 +809,13 @@ static struct m_config_option *m_config_mogrify_cli_opt(struct m_config *config,
|
|||||||
return co;
|
return co;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Resolve CLI alias. (We don't allow you to combine them with "--no-".)
|
||||||
|
co = m_config_get_co_raw(config, *name);
|
||||||
|
if (co && co->opt->type == &m_option_type_cli_alias)
|
||||||
|
*name = bstr0((char *)co->opt->priv);
|
||||||
|
|
||||||
// Might be a suffix "action", like "--vf-add". Expensively check for
|
// Might be a suffix "action", like "--vf-add". Expensively check for
|
||||||
// matches. (Also, we don't allow you to combine them with "--no-".)
|
// matches. (We don't allow you to combine them with "--no-".)
|
||||||
for (int n = 0; n < config->num_opts; n++) {
|
for (int n = 0; n < config->num_opts; n++) {
|
||||||
co = &config->opts[n];
|
co = &config->opts[n];
|
||||||
const struct m_option_type *type = co->opt->type;
|
const struct m_option_type *type = co->opt->type;
|
||||||
@ -902,8 +910,19 @@ int m_config_set_option_node(struct m_config *config, bstr name,
|
|||||||
int r;
|
int r;
|
||||||
|
|
||||||
struct m_config_option *co = m_config_get_co(config, name);
|
struct m_config_option *co = m_config_get_co(config, name);
|
||||||
if (!co)
|
if (!co) {
|
||||||
return M_OPT_UNKNOWN;
|
co = m_config_get_co_raw(config, name);
|
||||||
|
if (co && co->opt->type == &m_option_type_cli_alias) {
|
||||||
|
/*bstr old_name = name;
|
||||||
|
co = m_config_mogrify_cli_opt(config, &name, &(bool){0}, &(int){0});
|
||||||
|
*/
|
||||||
|
name = bstr0((char *)co->opt->priv);
|
||||||
|
MP_WARN(config, "Setting %.*s via API is deprecated, set %s instead.\n",
|
||||||
|
BSTR_P(name), co->opt->name);
|
||||||
|
} else {
|
||||||
|
return M_OPT_UNKNOWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Do this on an "empty" type to make setting the option strictly overwrite
|
// Do this on an "empty" type to make setting the option strictly overwrite
|
||||||
// the old value, as opposed to e.g. appending to lists.
|
// the old value, as opposed to e.g. appending to lists.
|
||||||
@ -1005,6 +1024,10 @@ void m_config_print_option_list(const struct m_config *config, const char *name)
|
|||||||
MP_INFO(config, " [file]");
|
MP_INFO(config, " [file]");
|
||||||
if (opt->flags & M_OPT_FIXED)
|
if (opt->flags & M_OPT_FIXED)
|
||||||
MP_INFO(config, " [no runtime changes]");
|
MP_INFO(config, " [no runtime changes]");
|
||||||
|
if (opt->type == &m_option_type_alias)
|
||||||
|
MP_INFO(config, " for %s", (char *)opt->priv);
|
||||||
|
if (opt->type == &m_option_type_cli_alias)
|
||||||
|
MP_INFO(config, " for %s (CLI/config files only)", (char *)opt->priv);
|
||||||
MP_INFO(config, "\n");
|
MP_INFO(config, "\n");
|
||||||
for (int n = 0; opt->type->actions && opt->type->actions[n].name; n++) {
|
for (int n = 0; opt->type->actions && opt->type->actions[n].name; n++) {
|
||||||
const struct m_option_action *action = &opt->type->actions[n];
|
const struct m_option_action *action = &opt->type->actions[n];
|
||||||
|
@ -1213,7 +1213,7 @@ static int parse_str_list_impl(struct mp_log *log, const m_option_t *opt,
|
|||||||
|
|
||||||
if (bstr_endswith0(name, "-add")) {
|
if (bstr_endswith0(name, "-add")) {
|
||||||
op = OP_ADD;
|
op = OP_ADD;
|
||||||
} else if (bstr_endswith0(name, "-add-str")) {
|
} else if (bstr_endswith0(name, "-append")) {
|
||||||
op = OP_ADD_STR;
|
op = OP_ADD_STR;
|
||||||
} else if (bstr_endswith0(name, "-pre")) {
|
} else if (bstr_endswith0(name, "-pre")) {
|
||||||
op = OP_PRE;
|
op = OP_PRE;
|
||||||
@ -1395,33 +1395,7 @@ const m_option_type_t m_option_type_string_list = {
|
|||||||
.set = str_list_set,
|
.set = str_list_set,
|
||||||
.actions = (const struct m_option_action[]){
|
.actions = (const struct m_option_action[]){
|
||||||
{"add"},
|
{"add"},
|
||||||
{"add-str"},
|
{"append"},
|
||||||
{"clr", M_OPT_TYPE_OPTIONAL_PARAM},
|
|
||||||
{"del"},
|
|
||||||
{"pre"},
|
|
||||||
{"set"},
|
|
||||||
{0}
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
static int parse_str_append_list(struct mp_log *log, const m_option_t *opt,
|
|
||||||
struct bstr name, struct bstr param, void *dst)
|
|
||||||
{
|
|
||||||
return parse_str_list_impl(log, opt, name, param, dst, OP_ADD_STR);
|
|
||||||
}
|
|
||||||
|
|
||||||
const m_option_type_t m_option_type_string_append_list = {
|
|
||||||
.name = "String list (append by default)",
|
|
||||||
.size = sizeof(char **),
|
|
||||||
.parse = parse_str_append_list,
|
|
||||||
.print = print_str_list,
|
|
||||||
.copy = copy_str_list,
|
|
||||||
.free = free_str_list,
|
|
||||||
.get = str_list_get,
|
|
||||||
.set = str_list_set,
|
|
||||||
.actions = (const struct m_option_action[]){
|
|
||||||
{"add"},
|
|
||||||
{"add-str"},
|
|
||||||
{"clr", M_OPT_TYPE_OPTIONAL_PARAM},
|
{"clr", M_OPT_TYPE_OPTIONAL_PARAM},
|
||||||
{"del"},
|
{"del"},
|
||||||
{"pre"},
|
{"pre"},
|
||||||
@ -3372,6 +3346,9 @@ const m_option_type_t m_option_type_node = {
|
|||||||
const m_option_type_t m_option_type_alias = {
|
const m_option_type_t m_option_type_alias = {
|
||||||
.name = "alias",
|
.name = "alias",
|
||||||
};
|
};
|
||||||
|
const m_option_type_t m_option_type_cli_alias = {
|
||||||
|
.name = "alias",
|
||||||
|
};
|
||||||
const m_option_type_t m_option_type_removed = {
|
const m_option_type_t m_option_type_removed = {
|
||||||
.name = "removed",
|
.name = "removed",
|
||||||
};
|
};
|
||||||
|
@ -65,6 +65,7 @@ extern const m_option_type_t m_option_type_node;
|
|||||||
|
|
||||||
// Used internally by m_config.c
|
// Used internally by m_config.c
|
||||||
extern const m_option_type_t m_option_type_alias;
|
extern const m_option_type_t m_option_type_alias;
|
||||||
|
extern const m_option_type_t m_option_type_cli_alias;
|
||||||
extern const m_option_type_t m_option_type_removed;
|
extern const m_option_type_t m_option_type_removed;
|
||||||
extern const m_option_type_t m_option_type_subconfig;
|
extern const m_option_type_t m_option_type_subconfig;
|
||||||
|
|
||||||
@ -579,8 +580,8 @@ extern const char m_option_path_separator;
|
|||||||
#define OPT_KEYVALUELIST(...) \
|
#define OPT_KEYVALUELIST(...) \
|
||||||
OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_keyvalue_list)
|
OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_keyvalue_list)
|
||||||
|
|
||||||
#define OPT_PATHLIST(...) \
|
#define OPT_PATHLIST(...) \
|
||||||
OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_append_list, \
|
OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_list,\
|
||||||
.priv = (void *)&m_option_path_separator)
|
.priv = (void *)&m_option_path_separator)
|
||||||
|
|
||||||
#define OPT_INT(...) \
|
#define OPT_INT(...) \
|
||||||
@ -713,6 +714,11 @@ extern const char m_option_path_separator;
|
|||||||
// Same, with a generic deprecation message.
|
// Same, with a generic deprecation message.
|
||||||
#define OPT_REPLACED(optname, newname) OPT_REPLACED_MSG(optname, newname, "")
|
#define OPT_REPLACED(optname, newname) OPT_REPLACED_MSG(optname, newname, "")
|
||||||
|
|
||||||
|
// Alias, resolved on the CLI/config file/profile parser level only.
|
||||||
|
#define OPT_CLI_ALIAS(optname, newname) \
|
||||||
|
{.name = optname, .type = &m_option_type_cli_alias, .priv = newname, \
|
||||||
|
.flags = M_OPT_NOPROP, .offset = -1}
|
||||||
|
|
||||||
// "--optname" doesn't exist, but inform the user about a replacement with msg.
|
// "--optname" doesn't exist, but inform the user about a replacement with msg.
|
||||||
#define OPT_REMOVED(optname, msg) \
|
#define OPT_REMOVED(optname, msg) \
|
||||||
{.name = optname, .type = &m_option_type_removed, .priv = msg, \
|
{.name = optname, .type = &m_option_type_removed, .priv = msg, \
|
||||||
|
@ -289,7 +289,8 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_STRINGLIST("reset-on-next-file", reset_options, 0),
|
OPT_STRINGLIST("reset-on-next-file", reset_options, 0),
|
||||||
|
|
||||||
#if HAVE_LUA || HAVE_JAVASCRIPT
|
#if HAVE_LUA || HAVE_JAVASCRIPT
|
||||||
OPT_PATHLIST("script", script_files, M_OPT_FIXED),
|
OPT_PATHLIST("scripts", script_files, M_OPT_FIXED),
|
||||||
|
OPT_CLI_ALIAS("script", "scripts-append"),
|
||||||
OPT_KEYVALUELIST("script-opts", script_opts, 0),
|
OPT_KEYVALUELIST("script-opts", script_opts, 0),
|
||||||
OPT_FLAG("load-scripts", auto_load_scripts, 0),
|
OPT_FLAG("load-scripts", auto_load_scripts, 0),
|
||||||
#endif
|
#endif
|
||||||
@ -375,7 +376,8 @@ const m_option_t mp_opts[] = {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// demuxer.c - select audio/sub file/demuxer
|
// demuxer.c - select audio/sub file/demuxer
|
||||||
OPT_PATHLIST("audio-file", audio_files, 0),
|
OPT_PATHLIST("audio-files", audio_files, 0),
|
||||||
|
OPT_CLI_ALIAS("audio-file", "audio-files-append"),
|
||||||
OPT_STRING("demuxer", demuxer_name, 0),
|
OPT_STRING("demuxer", demuxer_name, 0),
|
||||||
OPT_STRING("audio-demuxer", audio_demuxer_name, 0),
|
OPT_STRING("audio-demuxer", audio_demuxer_name, 0),
|
||||||
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
|
OPT_STRING("sub-demuxer", sub_demuxer_name, 0),
|
||||||
@ -459,10 +461,12 @@ const m_option_t mp_opts[] = {
|
|||||||
|
|
||||||
// ------------------------- subtitles options --------------------
|
// ------------------------- subtitles options --------------------
|
||||||
|
|
||||||
OPT_PATHLIST("sub-file", sub_name, 0),
|
OPT_PATHLIST("sub-files", sub_name, 0),
|
||||||
OPT_PATHLIST("sub-file-path", sub_paths, 0),
|
OPT_CLI_ALIAS("sub-file", "sub-files-append"),
|
||||||
OPT_PATHLIST("audio-file-path", audiofile_paths, 0),
|
OPT_PATHLIST("sub-file-paths", sub_paths, 0),
|
||||||
OPT_PATHLIST("external-file", external_files, 0),
|
OPT_PATHLIST("audio-file-paths", audiofile_paths, 0),
|
||||||
|
OPT_PATHLIST("external-files", external_files, 0),
|
||||||
|
OPT_CLI_ALIAS("external-file", "external-file-append"),
|
||||||
OPT_FLAG("autoload-files", autoload_files, 0),
|
OPT_FLAG("autoload-files", autoload_files, 0),
|
||||||
OPT_FLOAT("sub-delay", sub_delay, UPDATE_OSD),
|
OPT_FLOAT("sub-delay", sub_delay, UPDATE_OSD),
|
||||||
OPT_FLOAT("sub-fps", sub_fps, UPDATE_OSD),
|
OPT_FLOAT("sub-fps", sub_fps, UPDATE_OSD),
|
||||||
@ -832,10 +836,7 @@ const m_option_t mp_opts[] = {
|
|||||||
OPT_REMOVED("fs-black-out-screens", NULL),
|
OPT_REMOVED("fs-black-out-screens", NULL),
|
||||||
OPT_REPLACED_MSG("loop", "loop-playlist", "--loop will be changed to map to"
|
OPT_REPLACED_MSG("loop", "loop-playlist", "--loop will be changed to map to"
|
||||||
" --loop-file in future releases."),
|
" --loop-file in future releases."),
|
||||||
OPT_REPLACED_MSG("sub-paths", "sub-file-path",
|
OPT_REPLACED("sub-paths", "sub-file-paths"),
|
||||||
"passing multiple paths works differently now"),
|
|
||||||
OPT_REPLACED_MSG("audio-file-paths", "audio-file-path",
|
|
||||||
"passing multiple paths works differently now"),
|
|
||||||
|
|
||||||
{0}
|
{0}
|
||||||
};
|
};
|
||||||
|
@ -3717,6 +3717,37 @@ done:
|
|||||||
return mp_property_do(real_property, action, arg, ctx);
|
return mp_property_do(real_property, action, arg, ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int mp_property_shitfuck(void *ctx, struct m_property *prop,
|
||||||
|
int action, void *arg)
|
||||||
|
{
|
||||||
|
MPContext *mpctx = ctx;
|
||||||
|
int flags = M_SETOPT_RUNTIME;
|
||||||
|
const char *rname = prop->priv;
|
||||||
|
|
||||||
|
MP_WARN(mpctx, "Do not use %s, use %s, bug reports will be ignored.\n",
|
||||||
|
prop->name, rname);
|
||||||
|
|
||||||
|
struct m_config_option *co = m_config_get_co_raw(mpctx->mconfig, bstr0(rname));
|
||||||
|
if (!co)
|
||||||
|
return M_PROPERTY_UNKNOWN;
|
||||||
|
|
||||||
|
switch (action) {
|
||||||
|
case M_PROPERTY_GET_TYPE:
|
||||||
|
*(struct m_option *)arg = *(co->opt);
|
||||||
|
return M_PROPERTY_OK;
|
||||||
|
case M_PROPERTY_GET:
|
||||||
|
if (!co->data)
|
||||||
|
return M_PROPERTY_NOT_IMPLEMENTED;
|
||||||
|
m_option_copy(co->opt, arg, co->data);
|
||||||
|
return M_PROPERTY_OK;
|
||||||
|
case M_PROPERTY_SET:
|
||||||
|
if (m_config_set_option_raw_direct(mpctx->mconfig, co, arg, flags) < 0)
|
||||||
|
return M_PROPERTY_ERROR;
|
||||||
|
return M_PROPERTY_OK;
|
||||||
|
}
|
||||||
|
return M_PROPERTY_NOT_IMPLEMENTED;
|
||||||
|
}
|
||||||
|
|
||||||
static int access_options(struct m_property_action_arg *ka, bool local,
|
static int access_options(struct m_property_action_arg *ka, bool local,
|
||||||
MPContext *mpctx)
|
MPContext *mpctx)
|
||||||
{
|
{
|
||||||
@ -5726,7 +5757,8 @@ void command_init(struct MPContext *mpctx)
|
|||||||
for (int n = 0; n < num_opts; n++) {
|
for (int n = 0; n < num_opts; n++) {
|
||||||
struct m_config_option *co = m_config_get_co_index(mpctx->mconfig, n);
|
struct m_config_option *co = m_config_get_co_index(mpctx->mconfig, n);
|
||||||
assert(co->name[0]);
|
assert(co->name[0]);
|
||||||
if (co->opt->flags & M_OPT_NOPROP)
|
if ((co->opt->flags & M_OPT_NOPROP) &&
|
||||||
|
co->opt->type != &m_option_type_cli_alias)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
struct m_property prop = {0};
|
struct m_property prop = {0};
|
||||||
@ -5741,6 +5773,21 @@ void command_init(struct MPContext *mpctx)
|
|||||||
.priv = (void *)alias,
|
.priv = (void *)alias,
|
||||||
.is_option = true,
|
.is_option = true,
|
||||||
};
|
};
|
||||||
|
} else if (co->opt->type == &m_option_type_cli_alias) {
|
||||||
|
bstr rname = bstr0(co->opt->priv);
|
||||||
|
for (int i = rname.len - 1; i >= 0; i--) {
|
||||||
|
if (rname.start[i] == '-') {
|
||||||
|
rname.len = i;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
prop = (struct m_property){
|
||||||
|
.name = co->name,
|
||||||
|
.call = mp_property_shitfuck,
|
||||||
|
.priv = bstrto0(ctx, rname),
|
||||||
|
.is_option = true,
|
||||||
|
};
|
||||||
} else {
|
} else {
|
||||||
prop = (struct m_property){
|
prop = (struct m_property){
|
||||||
.name = co->name,
|
.name = co->name,
|
||||||
|
@ -395,9 +395,8 @@ const struct m_sub_options gl_video_conf = {
|
|||||||
({"no", BLEND_SUBS_NO},
|
({"no", BLEND_SUBS_NO},
|
||||||
{"yes", BLEND_SUBS_YES},
|
{"yes", BLEND_SUBS_YES},
|
||||||
{"video", BLEND_SUBS_VIDEO})),
|
{"video", BLEND_SUBS_VIDEO})),
|
||||||
OPT_STRINGLIST("opengl-shaders", user_shaders_old, M_OPT_FILE,
|
OPT_PATHLIST("opengl-shaders", user_shaders, 0),
|
||||||
.deprecation_message = "use --opengl-shader (1 for each file)"),
|
OPT_CLI_ALIAS("opengl-shader", "opengl-shaders-append"),
|
||||||
OPT_PATHLIST("opengl-shader", user_shaders, 0),
|
|
||||||
OPT_FLAG("deband", deband, 0),
|
OPT_FLAG("deband", deband, 0),
|
||||||
OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0),
|
OPT_SUBSTRUCT("deband", deband_opts, deband_conf, 0),
|
||||||
OPT_FLOAT("sharpen", unsharp, 0),
|
OPT_FLOAT("sharpen", unsharp, 0),
|
||||||
@ -1769,7 +1768,6 @@ static void gl_video_setup_hooks(struct gl_video *p)
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
pass_hook_user_shaders(p, p->opts.user_shaders_old);
|
|
||||||
pass_hook_user_shaders(p, p->opts.user_shaders);
|
pass_hook_user_shaders(p, p->opts.user_shaders);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3127,8 +3125,6 @@ static bool check_dumb_mode(struct gl_video *p)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (o->user_shaders_old && o->user_shaders_old[0])
|
|
||||||
return false;
|
|
||||||
if (o->user_shaders && o->user_shaders[0])
|
if (o->user_shaders && o->user_shaders[0])
|
||||||
return false;
|
return false;
|
||||||
if (p->use_lut_3d)
|
if (p->use_lut_3d)
|
||||||
|
@ -128,7 +128,6 @@ struct gl_video_opts {
|
|||||||
int interpolation;
|
int interpolation;
|
||||||
float interpolation_threshold;
|
float interpolation_threshold;
|
||||||
int blend_subs;
|
int blend_subs;
|
||||||
char **user_shaders_old;
|
|
||||||
char **user_shaders;
|
char **user_shaders;
|
||||||
int deband;
|
int deband;
|
||||||
struct deband_opts *deband_opts;
|
struct deband_opts *deband_opts;
|
||||||
|
Loading…
Reference in New Issue
Block a user