fftools: drop the fake "default" option from ffplay/ffprobe

It tries to process any unhandled options as AVOptions. Handle this
directly in cmdutils.c, without resorting to a confusing fake option
definition (which is currently visible to the users in -help output).
This commit is contained in:
Anton Khirnov
2022-03-09 21:46:43 +01:00
parent 1dd6363581
commit bd0cbebf3e
3 changed files with 7 additions and 3 deletions

View File

@@ -303,6 +303,12 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
int parse_option(void *optctx, const char *opt, const char *arg,
const OptionDef *options)
{
static const OptionDef opt_avoptions = {
.name = "AVOption passthrough",
.flags = HAS_ARG,
.u.func_arg = opt_default,
};
const OptionDef *po;
int ret;
@@ -316,7 +322,7 @@ int parse_option(void *optctx, const char *opt, const char *arg,
arg = "1";
if (!po->name)
po = find_option(options, "default");
po = &opt_avoptions;
if (!po->name) {
av_log(NULL, AV_LOG_ERROR, "Unrecognized option '%s'\n", opt);
return AVERROR(EINVAL);