]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
Merge remote-tracking branch 'luzero/segment'
[ffmpeg] / cmdutils.c
index c3fd8b87a384e1e33f0a7ea1de997cb0150a503a..00c5d7114453531b91ff44a3b2a3cac8b2360a1e 100644 (file)
@@ -130,6 +130,16 @@ void show_help_options(const OptionDef *options, const char *msg, int mask, int
     }
 }
 
+void show_help_children(const AVClass *class, int flags)
+{
+    const AVClass *child = NULL;
+    av_opt_show2(&class, NULL, flags, 0);
+    printf("\n");
+
+    while (child = av_opt_child_class_next(class, child))
+        show_help_children(child, flags);
+}
+
 static const OptionDef* find_option(const OptionDef *po, const char *name){
     const char *p = strchr(name, ':');
     int len = p ? p - name : strlen(name);
@@ -342,7 +352,7 @@ void parse_loglevel(int argc, char **argv, const OptionDef *options)
         opt_loglevel("loglevel", argv[idx + 1]);
 }
 
-#define FLAGS(o) ((o)->type == FF_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
+#define FLAGS(o) ((o)->type == AV_OPT_TYPE_FLAGS) ? AV_DICT_APPEND : 0
 int opt_default(const char *opt, const char *arg)
 {
     const AVOption *oc, *of, *os;
@@ -364,7 +374,7 @@ int opt_default(const char *opt, const char *arg)
     sc = sws_get_class();
     if ((os = av_opt_find(&sc, opt, NULL, 0, AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ))) {
         // XXX we only support sws_flags, not arbitrary sws options
-        int ret = av_set_string3(sws_opts, opt, arg, 1, NULL);
+        int ret = av_opt_set(sws_opts, opt, arg, 0);
         if (ret < 0) {
             av_log(NULL, AV_LOG_ERROR, "Error setting option %s.\n", opt);
             return ret;
@@ -413,6 +423,12 @@ int opt_loglevel(const char *opt, const char *arg)
     return 0;
 }
 
+int opt_codec_debug(const char *opt, const char *arg)
+{
+    av_log_set_level(AV_LOG_DEBUG);
+    return opt_default(opt, arg);
+}
+
 int opt_timelimit(const char *opt, const char *arg)
 {
 #if HAVE_SETRLIMIT