cmdutils: make show_usage() use av_log()
authorStefano Sabatini <stefasab@gmail.com>
Fri, 6 Jan 2012 18:08:13 +0000 (19:08 +0100)
committerStefano Sabatini <stefasab@gmail.com>
Sat, 7 Jan 2012 10:02:13 +0000 (11:02 +0100)
Avoid printing on stdout when show_usage is used in an error message.

avconv.c
ffmpeg.c
ffplay.c
ffprobe.c

index e02139d..9fae43a 100644 (file)
--- a/avconv.c
+++ b/avconv.c
@@ -4187,9 +4187,9 @@ static int opt_audio_qscale(OptionsContext *o, const char *opt, const char *arg)
 
 static void show_usage(void)
 {
-    printf("Hyper fast Audio and Video encoder\n");
-    printf("usage: %s [options] [[infile options] -i infile]... {[outfile options] outfile}...\n", program_name);
-    printf("\n");
+    av_log(NULL, AV_LOG_INFO, "Hyper fast Audio and Video encoder\n");
+    av_log(NULL, AV_LOG_INFO, "usage: %s [options] [[infile options] -i infile]... {[outfile options] outfile}...\n", program_name);
+    av_log(NULL, AV_LOG_INFO, "\n");
 }
 
 static int opt_help(const char *opt, const char *arg)
index 15ce089..13d7d6c 100644 (file)
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -4593,9 +4593,9 @@ static int opt_audio_qscale(OptionsContext *o, const char *opt, const char *arg)
 
 static void show_usage(void)
 {
-    printf("Hyper fast Audio and Video encoder\n");
-    printf("usage: %s [options] [[infile options] -i infile]... {[outfile options] outfile}...\n", program_name);
-    printf("\n");
+    av_log(NULL, AV_LOG_INFO, "Hyper fast Audio and Video encoder\n");
+    av_log(NULL, AV_LOG_INFO, "usage: %s [options] [[infile options] -i infile]... {[outfile options] outfile}...\n", program_name);
+    av_log(NULL, AV_LOG_INFO, "\n");
 }
 
 static int opt_help(const char *opt, const char *arg)
index 1a1b3f7..1c4289c 100644 (file)
--- a/ffplay.c
+++ b/ffplay.c
@@ -3105,9 +3105,9 @@ static const OptionDef options[] = {
 
 static void show_usage(void)
 {
-    printf("Simple media player\n");
-    printf("usage: %s [options] input_file\n", program_name);
-    printf("\n");
+    av_log(NULL, AV_LOG_INFO, "Simple media player\n");
+    av_log(NULL, AV_LOG_INFO, "usage: %s [options] input_file\n", program_name);
+    av_log(NULL, AV_LOG_INFO, "\n");
 }
 
 static int opt_help(const char *opt, const char *arg)
index 34626a8..28e0563 100644 (file)
--- a/ffprobe.c
+++ b/ffprobe.c
@@ -1439,9 +1439,9 @@ end:
 
 static void show_usage(void)
 {
-    printf("Simple multimedia streams analyzer\n");
-    printf("usage: %s [OPTIONS] [INPUT_FILE]\n", program_name);
-    printf("\n");
+    av_log(NULL, AV_LOG_INFO, "Simple multimedia streams analyzer\n");
+    av_log(NULL, AV_LOG_INFO, "usage: %s [OPTIONS] [INPUT_FILE]\n", program_name);
+    av_log(NULL, AV_LOG_INFO, "\n");
 }
 
 static int opt_format(const char *opt, const char *arg)