]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
Merge branch 'sws_32bit_integration'
[ffmpeg] / cmdutils.c
index c3c5c0efa9e30452ae96dde9742da54809394171..53266d4ebe3f20263fc96f4fc2c3cba0653fa257 100644 (file)
@@ -281,7 +281,7 @@ unknown_opt:
                 *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -INFINITY, INFINITY);
             } else if (po->u.func_arg) {
                 if (po->u.func_arg(opt, arg) < 0) {
-                    fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
+                    fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg ? arg : "[null]", opt);
                     exit(1);
                 }
             }
@@ -388,44 +388,8 @@ int opt_default(const char *opt, const char *arg){
         exit(1);
     }
     if (!o) {
-//<<<<<<< HEAD
         fprintf(stderr, "Unrecognized option '%s'\n", opt);
         exit(1);
-/*||||||| merged common ancestors
-        AVCodec *p = NULL;
-        AVOutputFormat *oformat = NULL;
-        while ((p=av_codec_next(p))){
-            const AVClass *c = p->priv_class;
-            if(c && av_find_opt(&c, opt, NULL, 0, 0))
-                break;
-        }
-        if (!p) {
-            while ((oformat = av_oformat_next(oformat))) {
-                const AVClass *c = oformat->priv_class;
-                if (c && av_find_opt(&c, opt, NULL, 0, 0))
-                    break;
-            }
-        }
-        if(!p && !oformat){
-            fprintf(stderr, "Unrecognized option '%s'\n", opt);
-            exit(1);
-        }
-=======
-        AVCodec *p = NULL;
-        AVOutputFormat *oformat = NULL;
-        while ((p=av_codec_next(p))){
-            const AVClass *c = p->priv_class;
-            if(c && av_opt_find(&c, opt, NULL, 0, 0))
-                break;
-        }
-        if (!p) {
-            while ((oformat = av_oformat_next(oformat))) {
-                const AVClass *c = oformat->priv_class;
-                if (c && av_opt_find(&c, opt, NULL, 0, 0))
-                    break;
-            }
-        }
->>>>>>> qatar/master*/
     }
 
  out:
@@ -530,7 +494,7 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec)
             if (av_find_opt(priv_ctx, opt_names[i], NULL, flags, flags)) {
                 if (av_set_string3(priv_ctx, opt_names[i], opt_values[i], 1, NULL) < 0) {
                     fprintf(stderr, "Invalid value '%s' for option '%s'\n",
-                            opt_names[i], opt_values[i]);
+                            opt_values[i], opt_names[i]);
                     exit(1);
                 }
             } else
@@ -610,12 +574,13 @@ void show_banner(void)
     print_all_libs_info(stderr, INDENT|SHOW_VERSION);
 }
 
-void show_version(void) {
+int opt_version(const char *opt, const char *arg) {
     printf("%s " FFMPEG_VERSION "\n", program_name);
     print_all_libs_info(stdout, SHOW_VERSION);
+    return 0;
 }
 
-void show_license(void)
+int opt_license(const char *opt, const char *arg)
 {
     printf(
 #if CONFIG_NONFREE
@@ -682,9 +647,10 @@ void show_license(void)
     program_name, program_name, program_name
 #endif
     );
+    return 0;
 }
 
-void show_formats(void)
+int opt_formats(const char *opt, const char *arg)
 {
     AVInputFormat *ifmt=NULL;
     AVOutputFormat *ofmt=NULL;
@@ -731,9 +697,10 @@ void show_formats(void)
             name,
             long_name ? long_name:" ");
     }
+    return 0;
 }
 
-void show_codecs(void)
+int opt_codecs(const char *opt, const char *arg)
 {
     AVCodec *p=NULL, *p2;
     const char *last_name;
@@ -807,9 +774,10 @@ void show_codecs(void)
 "even though both encoding and decoding are supported. For example, the h263\n"
 "decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
 "worse.\n");
+    return 0;
 }
 
-void show_bsfs(void)
+int opt_bsfs(const char *opt, const char *arg)
 {
     AVBitStreamFilter *bsf=NULL;
 
@@ -817,9 +785,10 @@ void show_bsfs(void)
     while((bsf = av_bitstream_filter_next(bsf)))
         printf("%s\n", bsf->name);
     printf("\n");
+    return 0;
 }
 
-void show_protocols(void)
+int opt_protocols(const char *opt, const char *arg)
 {
     URLProtocol *up=NULL;
 
@@ -835,9 +804,10 @@ void show_protocols(void)
                up->url_write ? 'O' : '.',
                up->url_seek  ? 'S' : '.',
                up->name);
+    return 0;
 }
 
-void show_filters(void)
+int opt_filters(const char *opt, const char *arg)
 {
     AVFilter av_unused(**filter) = NULL;
 
@@ -846,9 +816,10 @@ void show_filters(void)
     while ((filter = av_filter_next(filter)) && *filter)
         printf("%-16s %s\n", (*filter)->name, (*filter)->description);
 #endif
+    return 0;
 }
 
-void show_pix_fmts(void)
+int opt_pix_fmts(const char *opt, const char *arg)
 {
     enum PixelFormat pix_fmt;
 
@@ -879,6 +850,7 @@ void show_pix_fmts(void)
                pix_desc->nb_components,
                av_get_bits_per_pixel(pix_desc));
     }
+    return 0;
 }
 
 int read_yesno(void)