From 50008adf4af5360f87109d6264aa77ac82f2a80a Mon Sep 17 00:00:00 2001 From: wm4 Date: Mon, 26 Jun 2017 21:07:00 +0200 Subject: options: handle suffixes like -add in a more generic way This affects options like --vf or --display-tags. These used a "*" suffix to match all options starting with a specific name, and handled the rest in the option parser. Change this to remove the "*" special case, and require every option parser to declare a list of allowed suffixes via m_option_type.actions. The new way is conceptually simpler, because we don't have to account for the "*" in a bunch of places anymore, and instead everything is centrally handled in the CLI part of the option parser, where it's actually needed. It automatically enables suffixes like -add for a bunch of other stringlist options. --- common/encode_lavc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'common') diff --git a/common/encode_lavc.c b/common/encode_lavc.c index 5fbad39d44..2ae9eef6bd 100644 --- a/common/encode_lavc.c +++ b/common/encode_lavc.c @@ -39,13 +39,13 @@ const struct m_sub_options encode_config = { .opts = (const m_option_t[]) { OPT_STRING("o", file, M_OPT_FIXED | CONF_NOCFG | CONF_PRE_PARSE | M_OPT_FILE), OPT_STRING("of", format, M_OPT_FIXED), - OPT_STRINGLIST("ofopts*", fopts, M_OPT_FIXED), + OPT_STRINGLIST("ofopts", fopts, M_OPT_FIXED), OPT_FLOATRANGE("ofps", fps, M_OPT_FIXED, 0.0, 1000000.0), OPT_FLOATRANGE("omaxfps", maxfps, M_OPT_FIXED, 0.0, 1000000.0), OPT_STRING("ovc", vcodec, M_OPT_FIXED), - OPT_STRINGLIST("ovcopts*", vopts, M_OPT_FIXED), + OPT_STRINGLIST("ovcopts", vopts, M_OPT_FIXED), OPT_STRING("oac", acodec, M_OPT_FIXED), - OPT_STRINGLIST("oacopts*", aopts, M_OPT_FIXED), + OPT_STRINGLIST("oacopts", aopts, M_OPT_FIXED), OPT_FLAG("oharddup", harddup, M_OPT_FIXED), OPT_FLOATRANGE("ovoffset", voffset, M_OPT_FIXED, -1000000.0, 1000000.0), OPT_FLOATRANGE("oaoffset", aoffset, M_OPT_FIXED, -1000000.0, 1000000.0), -- cgit v1.2.3