[FFmpeg-cvslog] cmdline: Check options array for not working flag combinations

Michael Niedermayer git at videolan.org
Sat May 9 13:19:32 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat May  9 13:07:21 2015 +0200| [876c89a88f6470b8d90b54f05a6add84e996cba3] | committer: Michael Niedermayer

cmdline: Check options array for not working flag combinations

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 cmdutils.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/cmdutils.c b/cmdutils.c
index ed6951f..db89256 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -482,10 +482,22 @@ static void dump_argument(const char *a)
     fputc('"', report_file);
 }
 
+static void check_options(const OptionDef *po)
+{
+    while (po->name) {
+        if (po->flags & OPT_PERFILE)
+            av_assert0(po->flags & (OPT_INPUT | OPT_OUTPUT));
+        po++;
+    }
+}
+
 void parse_loglevel(int argc, char **argv, const OptionDef *options)
 {
     int idx = locate_option(argc, argv, options, "loglevel");
     const char *env;
+
+    check_options(options);
+
     if (!idx)
         idx = locate_option(argc, argv, options, "v");
     if (idx && argv[idx + 1])



More information about the ffmpeg-cvslog mailing list