---
 cmdutils.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 1c2bf46..672e1e4 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -288,7 +288,7 @@ void parse_options(void *optctx, int argc, char **argv, 
const OptionDef *options
                    void (* parse_arg_function)(void *, const char*))
 {
     const char *opt;
-    int optindex, handleoptions = 1, ret;
+    int optindex, handleoptions = 1, ret, last_parse_arg_index = 0;
 
     /* perform system-dependent conversions for arguments list */
     prepare_app_arguments(&argc, &argv);
@@ -311,8 +311,16 @@ void parse_options(void *optctx, int argc, char **argv, 
const OptionDef *options
         } else {
             if (parse_arg_function)
                 parse_arg_function(optctx, opt);
+            last_parse_arg_index = optindex;
         }
     }
+    if (optindex - last_parse_arg_index) {
+        int i;
+        av_log(NULL, AV_LOG_WARNING, "Trailing options found: ");
+        for (i = optindex - last_parse_arg_index; i > 0; i--)
+            av_log(NULL, AV_LOG_WARNING, "%s ", argv[argc - i]);
+        av_log(NULL, AV_LOG_WARNING, "they will be ignored.\n");
+    }
 }
 
 /*
-- 
1.7.2.5

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to