avprobe: fix function prototype
authorLuca Barbato <lu_zero@gentoo.org>
Fri, 25 May 2012 22:19:50 +0000 (15:19 -0700)
committerLuca Barbato <lu_zero@gentoo.org>
Fri, 25 May 2012 23:41:47 +0000 (16:41 -0700)
Make opt_output_format return the correct value.

avprobe.c

index 5313894..f809e46 100644 (file)
--- a/avprobe.c
+++ b/avprobe.c
@@ -757,7 +757,7 @@ static int opt_format(const char *opt, const char *arg)
     return 0;
 }
 
-static void opt_output_format(const char *opt, const char *arg)
+static int opt_output_format(const char *opt, const char *arg)
 {
 
     if (!strcmp(arg, "json")) {
@@ -781,8 +781,9 @@ static void opt_output_format(const char *opt, const char *arg)
         print_string  = ini_print_string;
     } else {
         av_log(NULL, AV_LOG_ERROR, "Unsupported formatter %s\n", arg);
-        exit(1);
+        return AVERROR(EINVAL);
     }
+    return 0;
 }
 
 static int opt_show_format_entry(const char *opt, const char *arg)