mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-06-03 11:00:06 +08:00
cmdutils: remove OPT_FUNC2
Make ff* tools only accept opt_* functions taking two arguments. The distinction between functions with one and two arguments is quite pointless. Simplify parse_options() code.
This commit is contained in:
@ -329,13 +329,14 @@ static void show_usage(void)
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
static void opt_format(const char *arg)
|
||||
static int opt_format(const char *opt, const char *arg)
|
||||
{
|
||||
iformat = av_find_input_format(arg);
|
||||
if (!iformat) {
|
||||
fprintf(stderr, "Unknown input format: %s\n", arg);
|
||||
exit(1);
|
||||
return AVERROR(EINVAL);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void opt_input_file(const char *arg)
|
||||
@ -382,7 +383,7 @@ static const OptionDef options[] = {
|
||||
{ "show_format", OPT_BOOL, {(void*)&do_show_format} , "show format/container info" },
|
||||
{ "show_packets", OPT_BOOL, {(void*)&do_show_packets}, "show packets info" },
|
||||
{ "show_streams", OPT_BOOL, {(void*)&do_show_streams}, "show streams info" },
|
||||
{ "default", OPT_FUNC2 | HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
|
||||
{ "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {(void*)opt_default}, "generic catch all option", "" },
|
||||
{ NULL, },
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user