mirror of https://github.com/mpv-player/mpv
m_option: change confusing error messages for obj_settings_list
This option type is not used only by filter options: they're already used by --ao, --vo, and --gpu-context. Replace the mentions of "filter" to "item" instead, and changes some languages to improve clarity. Also change the documentation on "Filter options" to describe what it really is, and fix a typo.
This commit is contained in:
parent
e968a505d6
commit
750dec880c
|
@ -557,7 +557,7 @@ Suffix Meaning
|
||||||
-pre Prepend 1 or more items (same syntax as -set)
|
-pre Prepend 1 or more items (same syntax as -set)
|
||||||
-clr Clear the option (remove all items)
|
-clr Clear the option (remove all items)
|
||||||
-remove Delete item if present (does not interpret escapes)
|
-remove Delete item if present (does not interpret escapes)
|
||||||
-toggle Append an item, or remove if if it already exists (no escapes)
|
-toggle Append an item, or remove it if it already exists (no escapes)
|
||||||
============= ===============================================
|
============= ===============================================
|
||||||
|
|
||||||
``-append`` is meant as a simple way to append a single item without having
|
``-append`` is meant as a simple way to append a single item without having
|
||||||
|
@ -591,23 +591,24 @@ appropriate structured data type.
|
||||||
|
|
||||||
Prior to mpv 0.33, ``:`` was also recognized as separator by ``-set``.
|
Prior to mpv 0.33, ``:`` was also recognized as separator by ``-set``.
|
||||||
|
|
||||||
Filter options
|
Object settings list options
|
||||||
~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
This is a very complex option type for the ``--af`` and ``--vf`` options only.
|
This is a very complex option type for some options, such as ``--af`` and ``--vf``.
|
||||||
They often require complicated escaping. See `VIDEO FILTERS`_ for details. They
|
They often require complicated escaping. See `VIDEO FILTERS`_ for details.
|
||||||
support the following operations:
|
|
||||||
|
They support the following operations:
|
||||||
|
|
||||||
============= ===============================================
|
============= ===============================================
|
||||||
Suffix Meaning
|
Suffix Meaning
|
||||||
============= ===============================================
|
============= ===============================================
|
||||||
-set Set a list of filters (using ``,`` as separator)
|
-set Set a list of items (using ``,`` as separator)
|
||||||
-append Append single filter
|
-append Append single item
|
||||||
-add Append 1 or more filters (same syntax as -set)
|
-add Append 1 or more items (same syntax as -set)
|
||||||
-pre Prepend 1 or more filters (same syntax as -set)
|
-pre Prepend 1 or more items (same syntax as -set)
|
||||||
-clr Clear the option (remove all filters)
|
-clr Clear the option (remove all items)
|
||||||
-remove Delete filter if present
|
-remove Delete item if present
|
||||||
-toggle Append a filter, or remove if if it already exists
|
-toggle Append an item, or remove it if it already exists
|
||||||
-help Pseudo operation that prints a help text to the terminal
|
-help Pseudo operation that prints a help text to the terminal
|
||||||
============= ===============================================
|
============= ===============================================
|
||||||
|
|
||||||
|
|
|
@ -3166,7 +3166,7 @@ print_help: ;
|
||||||
} else if (list->print_unknown_entry_help) {
|
} else if (list->print_unknown_entry_help) {
|
||||||
list->print_unknown_entry_help(log, mp_tprintf(80, "%.*s", BSTR_P(name)));
|
list->print_unknown_entry_help(log, mp_tprintf(80, "%.*s", BSTR_P(name)));
|
||||||
} else {
|
} else {
|
||||||
mp_warn(log, "Option %.*s: item %.*s doesn't exist.\n",
|
mp_warn(log, "Option %.*s: item '%.*s' isn't supported.\n",
|
||||||
BSTR_P(opt_name), BSTR_P(name));
|
BSTR_P(opt_name), BSTR_P(name));
|
||||||
}
|
}
|
||||||
r = M_OPT_EXIT;
|
r = M_OPT_EXIT;
|
||||||
|
@ -3221,7 +3221,7 @@ static int parse_obj_settings(struct mp_log *log, struct bstr opt, int op,
|
||||||
int idx = bstrspn(*pstr, NAMECH);
|
int idx = bstrspn(*pstr, NAMECH);
|
||||||
str = bstr_splice(*pstr, 0, idx);
|
str = bstr_splice(*pstr, 0, idx);
|
||||||
if (!str.len) {
|
if (!str.len) {
|
||||||
mp_err(log, "Option %.*s: filter name expected.\n", BSTR_P(opt));
|
mp_err(log, "Option %.*s: item name expected.\n", BSTR_P(opt));
|
||||||
return M_OPT_INVALID;
|
return M_OPT_INVALID;
|
||||||
}
|
}
|
||||||
*pstr = bstr_cut(*pstr, idx);
|
*pstr = bstr_cut(*pstr, idx);
|
||||||
|
@ -3238,7 +3238,7 @@ static int parse_obj_settings(struct mp_log *log, struct bstr opt, int op,
|
||||||
char name[80];
|
char name[80];
|
||||||
snprintf(name, sizeof(name), "%.*s", BSTR_P(str));
|
snprintf(name, sizeof(name), "%.*s", BSTR_P(str));
|
||||||
if (list->check_unknown_entry && !list->check_unknown_entry(name)) {
|
if (list->check_unknown_entry && !list->check_unknown_entry(name)) {
|
||||||
mp_err(log, "Option %.*s: %.*s doesn't exist.\n",
|
mp_err(log, "Option %.*s: '%.*s' isn't supported.\n",
|
||||||
BSTR_P(opt), BSTR_P(str));
|
BSTR_P(opt), BSTR_P(str));
|
||||||
return M_OPT_INVALID;
|
return M_OPT_INVALID;
|
||||||
}
|
}
|
||||||
|
@ -3332,15 +3332,15 @@ static int parse_obj_settings_list(struct mp_log *log, const m_option_t *opt,
|
||||||
" %s-set\n"
|
" %s-set\n"
|
||||||
" Overwrite the old list with the given list\n\n"
|
" Overwrite the old list with the given list\n\n"
|
||||||
" %s-append\n"
|
" %s-append\n"
|
||||||
" Append the given filter to the current list\n\n"
|
" Append the given item to the current list\n\n"
|
||||||
" %s-add\n"
|
" %s-add\n"
|
||||||
" Append the given list to the current list\n\n"
|
" Append the given list to the current list\n\n"
|
||||||
" %s-pre\n"
|
" %s-pre\n"
|
||||||
" Prepend the given list to the current list\n\n"
|
" Prepend the given list to the current list\n\n"
|
||||||
" %s-remove\n"
|
" %s-remove\n"
|
||||||
" Remove the given filter from the current list\n\n"
|
" Remove the given item from the current list\n\n"
|
||||||
" %s-toggle\n"
|
" %s-toggle\n"
|
||||||
" Add the filter to the list, or remove it if it's already added.\n\n"
|
" Add the item to the list, or remove it if it's already added.\n\n"
|
||||||
" %s-clr\n"
|
" %s-clr\n"
|
||||||
" Clear the current list.\n\n",
|
" Clear the current list.\n\n",
|
||||||
opt->name, opt->name, opt->name, opt->name, opt->name,
|
opt->name, opt->name, opt->name, opt->name, opt->name,
|
||||||
|
@ -3420,7 +3420,7 @@ static int parse_obj_settings_list(struct mp_log *log, const m_option_t *opt,
|
||||||
|
|
||||||
if (op != OP_NONE && res && res[0].name && res[1].name) {
|
if (op != OP_NONE && res && res[0].name && res[1].name) {
|
||||||
if (op == OP_APPEND) {
|
if (op == OP_APPEND) {
|
||||||
mp_err(log, "Option %.*s: -append takes only 1 filter (no ',').\n",
|
mp_err(log, "Option %.*s: -append takes only 1 item (no ',').\n",
|
||||||
BSTR_P(name));
|
BSTR_P(name));
|
||||||
free_obj_settings_list(&res);
|
free_obj_settings_list(&res);
|
||||||
return M_OPT_INVALID;
|
return M_OPT_INVALID;
|
||||||
|
|
Loading…
Reference in New Issue