]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Get rid of more senseless wraper functions and use OPT_EXIT instead.
authormichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 21 May 2008 23:41:17 +0000 (23:41 +0000)
committermichael <michael@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Wed, 21 May 2008 23:41:17 +0000 (23:41 +0000)
git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13233 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

ffmpeg.c
ffplay.c
ffserver.c

index b30ecbceb09f1ec0a4378f7bdfc34a83844882ae..995a775458b85b3f8094998cfc607eede5b0db51 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -3756,17 +3756,11 @@ static int opt_bsf(const char *opt, const char *arg)
     return 0;
 }
 
-static void opt_show_version(void)
-{
-    show_version();
-    av_exit(0);
-}
-
 static const OptionDef options[] = {
     /* main options */
     { "L", OPT_EXIT, {(void*)show_license}, "show license" },
     { "h", OPT_EXIT, {(void*)show_help}, "show help" },
-    { "version", 0, {(void*)opt_show_version}, "show version" },
+    { "version", OPT_EXIT, {(void*)show_version}, "show version" },
     { "formats", OPT_EXIT, {(void*)opt_show_formats}, "show available formats, codecs, protocols, ..." },
     { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
     { "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" },
index 02d0dc463276aec40b73406148340aa8fa398028..54b6e41c8359a5875ff9c385701a4b1d6f0895dd 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -2432,21 +2432,9 @@ static int opt_thread_count(const char *opt, const char *arg)
     return 0;
 }
 
-static void opt_show_help(void)
-{
-    show_help();
-    exit(0);
-}
-
-static void opt_show_version(void)
-{
-    show_version();
-    exit(0);
-}
-
 static const OptionDef options[] = {
-    { "h", 0, {(void*)opt_show_help}, "show help" },
-    { "version", 0, {(void*)opt_show_version}, "show version" },
+    { "h", OPT_EXIT, {(void*)show_help}, "show help" },
+    { "version", OPT_EXIT, {(void*)show_version}, "show version" },
     { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", "width" },
     { "y", HAS_ARG | OPT_FUNC2, {(void*)opt_height}, "force displayed height", "height" },
     { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
index 08a73be96946d8eeea8aa82e19dd89e3bec6d3b0..bc45a0e0e62f5a222f919c4457e2ddd761f0d17b 100644 (file)
@@ -4333,12 +4333,6 @@ static void handle_child_exit(int sig)
     need_to_start_children = 1;
 }
 
-static void opt_show_license(void)
-{
-    show_license();
-    exit(0);
-}
-
 static void opt_debug()
 {
     ffserver_debug = 1;
@@ -4351,12 +4345,11 @@ static void opt_show_help(void)
            "Hyper fast multi format Audio/Video streaming server\n");
     printf("\n");
     show_help_options(options, "Main options:\n", 0, 0);
-    exit(0);
 }
 
 static const OptionDef options[] = {
-    { "h", 0, {(void*)opt_show_help}, "show help" },
-    { "L", 0, {(void*)opt_show_license}, "show license" },
+    { "h", OPT_EXIT, {(void*)opt_show_help}, "show help" },
+    { "L", OPT_EXIT, {(void*)show_license}, "show license" },
     { "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
     { "d", 0, {(void*)opt_debug}, "enable debug mode" },
     { "f", HAS_ARG | OPT_STRING, {(void*)&config_filename }, "use configfile instead of /etc/ffserver.conf", "configfile" },