[FFmpeg-cvslog] fftools: drop the fake "default" option from ffplay/ffprobe

Anton Khirnov git at videolan.org
Tue Mar 22 19:58:01 EET 2022


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Mar  9 21:46:43 2022 +0100| [bd0cbebf3e495b5f41e8dd307311d6bcc6d7da85] | committer: Anton Khirnov

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).

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd0cbebf3e495b5f41e8dd307311d6bcc6d7da85
---

 fftools/cmdutils.c | 8 +++++++-
 fftools/ffplay.c   | 1 -
 fftools/ffprobe.c  | 1 -
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/fftools/cmdutils.c b/fftools/cmdutils.c
index 8d88f18fb3..e8047e575c 100644
--- a/fftools/cmdutils.c
+++ b/fftools/cmdutils.c
@@ -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);
diff --git a/fftools/ffplay.c b/fftools/ffplay.c
index 28f0961d3b..040afa0189 100644
--- a/fftools/ffplay.c
+++ b/fftools/ffplay.c
@@ -3598,7 +3598,6 @@ static const OptionDef options[] = {
 #endif
     { "rdftspeed", OPT_INT | HAS_ARG| OPT_AUDIO | OPT_EXPERT, { &rdftspeed }, "rdft speed", "msecs" },
     { "showmode", HAS_ARG, { .func_arg = opt_show_mode}, "select show mode (0 = video, 1 = waves, 2 = RDFT)", "mode" },
-    { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, { .func_arg = opt_default }, "generic catch all option", "" },
     { "i", OPT_BOOL, { &dummy}, "read specified file", "input_file"},
     { "codec", HAS_ARG, { .func_arg = opt_codec}, "force decoder", "decoder_name" },
     { "acodec", HAS_ARG | OPT_STRING | OPT_EXPERT, {    &audio_codec_name }, "force audio decoder",    "decoder_name" },
diff --git a/fftools/ffprobe.c b/fftools/ffprobe.c
index df87812e9e..05c167eeb5 100644
--- a/fftools/ffprobe.c
+++ b/fftools/ffprobe.c
@@ -3902,7 +3902,6 @@ static const OptionDef real_options[] = {
     { "private",           OPT_BOOL, { &show_private_data }, "same as show_private_data" },
     { "bitexact", OPT_BOOL, {&do_bitexact}, "force bitexact output" },
     { "read_intervals", HAS_ARG, {.func_arg = opt_read_intervals}, "set read intervals", "read_intervals" },
-    { "default", HAS_ARG | OPT_AUDIO | OPT_VIDEO | OPT_EXPERT, {.func_arg = opt_default}, "generic catch all option", "" },
     { "i", HAS_ARG, {.func_arg = opt_input_file_i}, "read specified file", "input_file"},
     { "print_filename", HAS_ARG, {.func_arg = opt_print_filename}, "override the printed input filename", "print_file"},
     { "find_stream_info", OPT_BOOL | OPT_INPUT | OPT_EXPERT, { &find_stream_info },



More information about the ffmpeg-cvslog mailing list