]> git.sesse.net Git - ffmpeg/blobdiff - cmdutils.c
Define missing llrint() as macro instead of inline function
[ffmpeg] / cmdutils.c
index faf8559667e7c9b2eca0c5201fb18d755e4725c5..24a8db2f1bd334ec2c46a0c93131f42790bc9918 100644 (file)
@@ -170,8 +170,10 @@ unknown_opt:
             } else if (po->flags & OPT_FLOAT) {
                 *po->u.float_arg = parse_number_or_die(opt, arg, OPT_FLOAT, -1.0/0.0, 1.0/0.0);
             } else if (po->flags & OPT_FUNC2) {
-                if(po->u.func2_arg(opt, arg)<0)
-                    goto unknown_opt;
+                if (po->u.func2_arg(opt, arg) < 0) {
+                    fprintf(stderr, "%s: invalid value '%s' for option '%s'\n", argv[0], arg, opt);
+                    exit(1);
+                }
             } else {
                 po->u.func_arg(arg);
             }
@@ -262,7 +264,7 @@ int opt_loglevel(const char *opt, const char *arg)
 
 int opt_timelimit(const char *opt, const char *arg)
 {
-#if HAVE_SYS_RESOURCE_H
+#if HAVE_SETRLIMIT
     int lim = parse_number_or_die(opt, arg, OPT_INT64, 0, INT_MAX);
     struct rlimit rl = { lim, lim + 1 };
     if (setrlimit(RLIMIT_CPU, &rl))
@@ -324,17 +326,19 @@ void print_error(const char *filename, int err)
     }
 }
 
-#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent) \
-    if (CONFIG_##LIBNAME) { \
-    version= libname##_version(); \
-    fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n", indent? "  " : "", #libname, \
-            LIB##LIBNAME##_VERSION_MAJOR, LIB##LIBNAME##_VERSION_MINOR, LIB##LIBNAME##_VERSION_MICRO, \
-            version >> 16, version >> 8 & 0xff, version & 0xff); \
+#define PRINT_LIB_VERSION(outstream,libname,LIBNAME,indent)             \
+    if (CONFIG_##LIBNAME) {                                             \
+        unsigned int version = libname##_version();                     \
+        fprintf(outstream, "%slib%-10s %2d.%2d.%2d / %2d.%2d.%2d\n",    \
+                indent? "  " : "", #libname,                            \
+                LIB##LIBNAME##_VERSION_MAJOR,                           \
+                LIB##LIBNAME##_VERSION_MINOR,                           \
+                LIB##LIBNAME##_VERSION_MICRO,                           \
+                version >> 16, version >> 8 & 0xff, version & 0xff);    \
     }
 
 static void print_all_lib_versions(FILE* outstream, int indent)
 {
-    unsigned int version;
     PRINT_LIB_VERSION(outstream, avutil,   AVUTIL,   indent);
     PRINT_LIB_VERSION(outstream, avcodec,  AVCODEC,  indent);
     PRINT_LIB_VERSION(outstream, avformat, AVFORMAT, indent);