Browse code

Get rid of more senseless wrapper functions and use OPT_EXIT instead.

Originally committed as revision 13233 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2008/05/22 08:41:17
Showing 3 changed files
... ...
@@ -3756,17 +3756,11 @@ static int opt_bsf(const char *opt, const char *arg)
3756 3756
     return 0;
3757 3757
 }
3758 3758
 
3759
-static void opt_show_version(void)
3760
-{
3761
-    show_version();
3762
-    av_exit(0);
3763
-}
3764
-
3765 3759
 static const OptionDef options[] = {
3766 3760
     /* main options */
3767 3761
     { "L", OPT_EXIT, {(void*)show_license}, "show license" },
3768 3762
     { "h", OPT_EXIT, {(void*)show_help}, "show help" },
3769
-    { "version", 0, {(void*)opt_show_version}, "show version" },
3763
+    { "version", OPT_EXIT, {(void*)show_version}, "show version" },
3770 3764
     { "formats", OPT_EXIT, {(void*)opt_show_formats}, "show available formats, codecs, protocols, ..." },
3771 3765
     { "f", HAS_ARG, {(void*)opt_format}, "force format", "fmt" },
3772 3766
     { "i", HAS_ARG, {(void*)opt_input_file}, "input file name", "filename" },
... ...
@@ -2432,21 +2432,9 @@ static int opt_thread_count(const char *opt, const char *arg)
2432 2432
     return 0;
2433 2433
 }
2434 2434
 
2435
-static void opt_show_help(void)
2436
-{
2437
-    show_help();
2438
-    exit(0);
2439
-}
2440
-
2441
-static void opt_show_version(void)
2442
-{
2443
-    show_version();
2444
-    exit(0);
2445
-}
2446
-
2447 2435
 static const OptionDef options[] = {
2448
-    { "h", 0, {(void*)opt_show_help}, "show help" },
2449
-    { "version", 0, {(void*)opt_show_version}, "show version" },
2436
+    { "h", OPT_EXIT, {(void*)show_help}, "show help" },
2437
+    { "version", OPT_EXIT, {(void*)show_version}, "show version" },
2450 2438
     { "x", HAS_ARG | OPT_FUNC2, {(void*)opt_width}, "force displayed width", "width" },
2451 2439
     { "y", HAS_ARG | OPT_FUNC2, {(void*)opt_height}, "force displayed height", "height" },
2452 2440
     { "s", HAS_ARG | OPT_VIDEO, {(void*)opt_frame_size}, "set frame size (WxH or abbreviation)", "size" },
... ...
@@ -4333,12 +4333,6 @@ static void handle_child_exit(int sig)
4333 4333
     need_to_start_children = 1;
4334 4334
 }
4335 4335
 
4336
-static void opt_show_license(void)
4337
-{
4338
-    show_license();
4339
-    exit(0);
4340
-}
4341
-
4342 4336
 static void opt_debug()
4343 4337
 {
4344 4338
     ffserver_debug = 1;
... ...
@@ -4351,12 +4345,11 @@ static void opt_show_help(void)
4351 4351
            "Hyper fast multi format Audio/Video streaming server\n");
4352 4352
     printf("\n");
4353 4353
     show_help_options(options, "Main options:\n", 0, 0);
4354
-    exit(0);
4355 4354
 }
4356 4355
 
4357 4356
 static const OptionDef options[] = {
4358
-    { "h", 0, {(void*)opt_show_help}, "show help" },
4359
-    { "L", 0, {(void*)opt_show_license}, "show license" },
4357
+    { "h", OPT_EXIT, {(void*)opt_show_help}, "show help" },
4358
+    { "L", OPT_EXIT, {(void*)show_license}, "show license" },
4360 4359
     { "n", OPT_BOOL, {(void *)&no_launch }, "enable no-launch mode" },
4361 4360
     { "d", 0, {(void*)opt_debug}, "enable debug mode" },
4362 4361
     { "f", HAS_ARG | OPT_STRING, {(void*)&config_filename }, "use configfile instead of /etc/ffserver.conf", "configfile" },