diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-24 18:14:42 +0200 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2011-05-28 18:23:05 +0200 |
commit | eb8bc57240d5d3e4680ff1df18a0a7792e96bd0c (patch) | |
tree | b3dc566505456d6a121bc0e3f03883e52bd7ac7a /ffprobe.c | |
parent | 78046dadc3145a7afd16034ab1178033a053a03e (diff) | |
download | ffmpeg-streaming-eb8bc57240d5d3e4680ff1df18a0a7792e96bd0c.zip ffmpeg-streaming-eb8bc57240d5d3e4680ff1df18a0a7792e96bd0c.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.
Diffstat (limited to 'ffprobe.c')
-rw-r--r-- | ffprobe.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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, }, }; |