[FFmpeg-cvslog] lavu/log: do not skip overwritten lines.

Nicolas George git at videolan.org
Wed Aug 7 19:16:39 CEST 2013


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Wed Aug  7 15:50:27 2013 +0200| [39bb26f91b18a6fb6d2ccfb6464b8a87787587fe] | committer: Nicolas George

lavu/log: do not skip overwritten lines.

If the line ends with \r, it will not flood the tty, and
the "Last message repeated" line would overwrite it.
Fix bug introduced by c25d1ba.

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

 libavutil/log.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libavutil/log.c b/libavutil/log.c
index 29ad2d0..cde7c12 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -224,7 +224,8 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl)
         is_atty = isatty(2) ? 1 : -1;
 #endif
 
-    if (print_prefix && (flags & AV_LOG_SKIP_REPEATED) && !strcmp(line, prev) && *line){
+    if (print_prefix && (flags & AV_LOG_SKIP_REPEATED) && !strcmp(line, prev) &&
+        *line && line[strlen(line) - 1] != '\r'){
         count++;
         if (is_atty == 1)
             fprintf(stderr, "    Last message repeated %d times\r", count);



More information about the ffmpeg-cvslog mailing list