diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-28 01:53:00 +0200 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-05-28 09:40:19 -0400 |
commit | 26513856d657de3b3afacae7c13fd99a7fe79d05 (patch) | |
tree | 89f497b6b71cd57d94e91d721772e575141325df /ffprobe.c | |
parent | 009f829dde811af654af7110326aea3a72c05d5e (diff) | |
download | ffmpeg-26513856d657de3b3afacae7c13fd99a7fe79d05.tar.gz |
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.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
Diffstat (limited to 'ffprobe.c')
-rw-r--r-- | ffprobe.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -326,13 +326,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) @@ -379,7 +380,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, }, }; |