]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
Merge remote-tracking branch 'qatar/master'
[ffmpeg] / cmdutils.c
index 8b8eacc3b13c752d7c23a76f6a1d3f8240389621..09a5ce139c2b88878c4cecb60ffe1908ef802aba 100644 (file)
@@ -278,7 +278,7 @@ static int write_option(void *optctx, const OptionDef *po, const char *opt,
     if (po->flags & OPT_STRING) {
         char *str;
         str = av_strdup(arg);
-//         av_freep(dst);
+        av_freep(dst);
         *(char **)dst = str;
     } else if (po->flags & OPT_BOOL || po->flags & OPT_INT) {
         *(int *)dst = parse_number_or_die(opt, arg, OPT_INT64, INT_MIN, INT_MAX);
@@ -795,6 +795,13 @@ int opt_loglevel(void *optctx, const char *opt, const char *arg)
     int level;
     int i;
 
+    tail = strstr(arg, "repeat");
+    av_log_set_flags(tail ? 0 : AV_LOG_SKIP_REPEATED);
+    if (tail == arg)
+        arg += 6 + (arg[6]=='+');
+    if(tail && !*arg)
+        return 0;
+
     for (i = 0; i < FF_ARRAY_ELEMS(log_levels); i++) {
         if (!strcmp(log_levels[i].name, arg)) {
             av_log_set_level(log_levels[i].level);
@@ -1606,6 +1613,28 @@ static void show_help_muxer(const char *name)
         show_help_children(fmt->priv_class, AV_OPT_FLAG_ENCODING_PARAM);
 }
 
+static void show_help_filter(const char *name)
+{
+    const AVFilter *filter;
+
+    if (!name) {
+        av_log(NULL, AV_LOG_ERROR, "No filter name specified.\n");
+        return;
+    }
+    filter = avfilter_get_by_name(name);
+    if (!filter) {
+        av_log(NULL, AV_LOG_ERROR, "Filter '%s' not found.\n", name);
+        return;
+    }
+    printf("Filter %s\n", filter->name);
+    if (filter->description)
+        printf("  %s\n", filter->description);
+    if (filter->priv_class)
+        show_help_children(filter->priv_class, AV_OPT_FLAG_FILTERING_PARAM);
+    else
+        printf("No AVOption available\n");
+}
+
 int show_help(void *optctx, const char *opt, const char *arg)
 {
     char *topic, *par;
@@ -1626,6 +1655,8 @@ int show_help(void *optctx, const char *opt, const char *arg)
         show_help_demuxer(par);
     } else if (!strcmp(topic, "muxer")) {
         show_help_muxer(par);
+    } else if (!strcmp(topic, "filter")) {
+        show_help_filter(par);
     } else {
         show_help_default(topic, par);
     }