summaryrefslogtreecommitdiffstats
path: root/options/m_option.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2020-04-09 11:20:45 +0200
committerwm4 <wm4@nowhere>2020-04-09 11:20:45 +0200
commit823e5205eac66e5bff0953605b5b6c9ddde54739 (patch)
treea0255dbb56802d5b8f2375e0471dbd6d454f0f26 /options/m_option.c
parent9d32d62b6154784a4e38dcb0ff50b8331e9169bf (diff)
downloadmpv-823e5205eac66e5bff0953605b5b6c9ddde54739.tar.bz2
mpv-823e5205eac66e5bff0953605b5b6c9ddde54739.tar.xz
options: make imgfmt options always accept "no"
This was optional, with the intention that normally such options require a valid format. But there is no reason for this (at least not anymore), and it's actually more logical to accept "no" in all situations this option type is used. This also gets rid of the weird min field special use.
Diffstat (limited to 'options/m_option.c')
-rw-r--r--options/m_option.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/options/m_option.c b/options/m_option.c
index fcc52406ff..aa1ac71ae6 100644
--- a/options/m_option.c
+++ b/options/m_option.c
@@ -2356,8 +2356,6 @@ const m_option_type_t m_option_type_size_box = {
static int parse_imgfmt(struct mp_log *log, const m_option_t *opt,
struct bstr name, struct bstr param, void *dst)
{
- bool accept_no = opt->min < 0;
-
if (param.len == 0)
return M_OPT_MISSING_PARAM;
@@ -2366,15 +2364,14 @@ static int parse_imgfmt(struct mp_log *log, const m_option_t *opt,
char **list = mp_imgfmt_name_list();
for (int i = 0; list[i]; i++)
mp_info(log, " %s", list[i]);
- if (accept_no)
- mp_info(log, " no");
+ mp_info(log, " no");
mp_info(log, "\n");
talloc_free(list);
return M_OPT_EXIT;
}
unsigned int fmt = mp_imgfmt_from_name(param);
- if (!fmt && !(accept_no && bstr_equals0(param, "no"))) {
+ if (!fmt && !bstr_equals0(param, "no")) {
mp_err(log, "Option %.*s: unknown format name: '%.*s'\n",
BSTR_P(name), BSTR_P(param));
return M_OPT_INVALID;