[FFmpeg-cvslog] ffmpeg: fix -stats -v 0

Michael Niedermayer git at videolan.org
Sun Mar 3 19:38:59 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Mar  3 19:33:37 2013 +0100| [9af8179cdb5eb05e9b29b0a4d0c363d22b674e95] | committer: Michael Niedermayer

ffmpeg: fix -stats -v 0

Fixes Ticket1687

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9af8179cdb5eb05e9b29b0a4d0c363d22b674e95
---

 ffmpeg.c     |    5 ++++-
 ffmpeg_opt.c |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ffmpeg.c b/ffmpeg.c
index 5bc98a7..04a8457 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -1269,7 +1269,10 @@ static void print_report(int is_last_report, int64_t timer_start, int64_t cur_ti
     av_bprintf(&buf_script, "drop_frames=%d\n", nb_frames_drop);
 
     if (print_stats || is_last_report) {
-    av_log(NULL, AV_LOG_INFO, "%s    \r", buf);
+        if (print_stats==1 && AV_LOG_INFO > av_log_get_level()) {
+            fprintf(stderr, "%s    \r", buf);
+        } else
+            av_log(NULL, AV_LOG_INFO, "%s    \r", buf);
 
     fflush(stderr);
     }
diff --git a/ffmpeg_opt.c b/ffmpeg_opt.c
index 22d6e41..8d198f8 100644
--- a/ffmpeg_opt.c
+++ b/ffmpeg_opt.c
@@ -81,7 +81,7 @@ int copy_ts           = 0;
 int copy_tb           = -1;
 int debug_ts          = 0;
 int exit_on_error     = 0;
-int print_stats       = 1;
+int print_stats       = -1;
 int qp_hist           = 0;
 int stdin_interaction = 1;
 int frame_bits_per_raw_sample = 0;



More information about the ffmpeg-cvslog mailing list