]> git.sesse.net Git - ffmpeg/blobdiff - ffmpeg.c
Get rid of more senseless wrapper functions and use OPT_EXIT instead.
[ffmpeg] / ffmpeg.c
index 4e6714d827c76f2048aa67af329a63e10bb754f4..995a775458b85b3f8094998cfc607eede5b0db51 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -63,7 +63,7 @@
 
 #undef exit
 
-static const char program_name[] = "FFmpeg";
+const char program_name[] = "FFmpeg";
 static const int program_birth_year = 2000;
 
 /* select an input stream for an output stream */
@@ -1066,7 +1066,7 @@ static void print_report(AVFormatContext **output_files,
         bitrate = (double)(total_size * 8) / ti1 / 1000.0;
 
         snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
-            "size=%8.0fkB time=%0.1f bitrate=%6.1fkbits/s",
+            "size=%8.0fkB time=%0.2f bitrate=%6.1fkbits/s",
             (double)total_size / 1024, ti1, bitrate);
 
         if (verbose > 1)
@@ -3466,14 +3466,15 @@ static void opt_show_formats(void)
             break;
         }
         printf(
-            " %s%s%s%s%s%s %s",
+            " %s%s%s%s%s%s %-15s %s",
             decode ? "D": (/*p2->decoder ? "d":*/" "),
             encode ? "E":" ",
             type_str,
             cap & CODEC_CAP_DRAW_HORIZ_BAND ? "S":" ",
             cap & CODEC_CAP_DR1 ? "D":" ",
             cap & CODEC_CAP_TRUNCATED ? "T":" ",
-            p2->name);
+            p2->name,
+            p2->long_name ? p2->long_name : "");
        /* if(p2->decoder && decode==0)
             printf(" use %s for decoding", p2->decoder->name);*/
         printf("\n");
@@ -3498,7 +3499,6 @@ static void opt_show_formats(void)
 "even though both encoding and decoding are supported. For example, the h263\n"
 "decoder corresponds to the h263 and h263p encoders, for file formats it is even\n"
 "worse.\n");
-    av_exit(0);
 }
 
 static void parse_matrix_coeffs(uint16_t *dest, const char *str)
@@ -3573,12 +3573,6 @@ static void show_help(void)
     av_opt_show(sws_opts, NULL);
 }
 
-static void opt_show_help(void)
-{
-    show_help();
-    av_exit(0);
-}
-
 static void opt_target(const char *arg)
 {
     int norm = -1;
@@ -3762,24 +3756,12 @@ static int opt_bsf(const char *opt, const char *arg)
     return 0;
 }
 
-static void opt_show_license(void)
-{
-    show_license();
-    av_exit(0);
-}
-
-static void opt_show_version(void)
-{
-    show_version(program_name);
-    av_exit(0);
-}
-
 static const OptionDef options[] = {
     /* main options */
-    { "L", 0, {(void*)opt_show_license}, "show license" },
-    { "h", 0, {(void*)opt_show_help}, "show help" },
-    { "version", 0, {(void*)opt_show_version}, "show version" },
-    { "formats", 0, {(void*)opt_show_formats}, "show available formats, codecs, protocols, ..." },
+    { "L", OPT_EXIT, {(void*)show_license}, "show license" },
+    { "h", OPT_EXIT, {(void*)show_help}, "show help" },
+    { "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" },
     { "y", OPT_BOOL, {(void*)&file_overwrite}, "overwrite output files" },