[FFmpeg-cvslog] cmdutils: allow ':'-separated modifiers in option names.

Anton Khirnov git at videolan.org
Sat Aug 13 03:18:02 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Fri Jul 29 13:47:37 2011 +0200| [d70e51225062239c250ab6bc935b9711cf97c615] | committer: Anton Khirnov

cmdutils: allow ':'-separated modifiers in option names.

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

 cmdutils.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index d3fdae7..1df2556 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -141,8 +141,11 @@ void show_help_options(const OptionDef *options, const char *msg, int mask, int
 }
 
 static const OptionDef* find_option(const OptionDef *po, const char *name){
+    const char *p = strchr(name, ':');
+    int len = p ? p - name : strlen(name);
+
     while (po->name != NULL) {
-        if (!strcmp(name, po->name))
+        if (!strncmp(name, po->name, len) && strlen(po->name) == len)
             break;
         po++;
     }



More information about the ffmpeg-cvslog mailing list