1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-03 13:32:16 +00:00

options: don't report errors on help value for OPT_SIZE_BOX

The same idea as in 3723e61 but for OPT_SIZE_BOX now.

Affects options `autofit`, `autofit-larger` and `autofit-smaller`.
This commit is contained in:
pavelxdd 2017-12-16 01:29:05 +03:00
parent 0e311fc0e8
commit 7fc9ff54d3

View File

@ -1996,6 +1996,10 @@ const m_option_type_t m_option_type_geometry = {
static int parse_size_box(struct mp_log *log, const m_option_t *opt,
struct bstr name, struct bstr param, void *dst)
{
bool is_help = bstr_equals0(param, "help");
if (is_help)
goto error;
struct m_geometry gm;
if (!parse_geometry_str(&gm, param))
goto error;
@ -2009,10 +2013,12 @@ static int parse_size_box(struct mp_log *log, const m_option_t *opt,
return 1;
error:
mp_err(log, "Option %.*s: invalid size: '%.*s'\n",
BSTR_P(name), BSTR_P(param));
mp_err(log, "Valid format: W[%%][xH[%%]] or empty string\n");
return M_OPT_INVALID;
if (!is_help) {
mp_err(log, "Option %.*s: invalid size: '%.*s'\n",
BSTR_P(name), BSTR_P(param));
}
mp_info(log, "Valid format: W[%%][xH[%%]] or empty string\n");
return is_help ? M_OPT_EXIT : M_OPT_INVALID;
}
const m_option_type_t m_option_type_size_box = {