[FFmpeg-devel] [PATCH] cmdutils: show options in show_help_children only if the context has options

Stefano Sabatini stefasab at gmail.com
Thu Aug 9 22:58:11 CEST 2012


Avoid to print a pointless name of the context followed by an empty list.
---
 cmdutils.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/cmdutils.c b/cmdutils.c
index 7d71d65..6859692 100644
--- a/cmdutils.c
+++ b/cmdutils.c
@@ -168,8 +168,10 @@ void show_help_options(const OptionDef *options, const char *msg, int mask,
 void show_help_children(const AVClass *class, int flags)
 {
     const AVClass *child = NULL;
-    av_opt_show2(&class, NULL, flags, 0);
-    printf("\n");
+    if (class->option) {
+        av_opt_show2(&class, NULL, flags, 0);
+        printf("\n");
+    }
 
     while (child = av_opt_child_class_next(class, child))
         show_help_children(child, flags);
-- 
1.7.5.4



More information about the ffmpeg-devel mailing list