]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
lavf: fix av_find_best_stream when providing a wanted stream.
[ffmpeg] / cmdutils.c
index 59f0ce7fd186e5554a3a7eff7dfa1e4bc86ff2e8..feeea694d818f0e76470b83d8c0abdff910d42b6 100644 (file)
@@ -107,6 +107,8 @@ double parse_number_or_die(const char *context, const char *numstr, int type, do
         error= "The value for %s was %s which is not within %f - %f\n";
     else if(type == OPT_INT64 && (int64_t)d != d)
         error= "Expected int64 for %s but found %s\n";
+    else if (type == OPT_INT && (int)d != d)
+        error= "Expected int for %s but found %s\n";
     else
         return d;
     fprintf(stderr, error, context, numstr, min, max);
@@ -279,8 +281,8 @@ unknown_opt:
                     fprintf(stderr, "%s: failed to set value '%s' for option '%s'\n", argv[0], arg, opt);
                     exit(1);
                 }
-            } else {
-                po->u.func_arg(arg);
+            } else if (po->u.func_arg) {
+                    po->u.func_arg(arg);
             }
             if(po->flags & OPT_EXIT)
                 exit(0);