[FFmpeg-cvslog] lavu/log: print prefix after \r.

Nicolas George git at videolan.org
Sat Jul 20 12:12:30 CEST 2013


ffmpeg | branch: master | Nicolas George <nicolas.george at normalesup.org> | Fri Jul 19 15:32:25 2013 +0200| [c25d1ba55636504c2b6a9c6987cf4c80fdc7091c] | committer: Nicolas George

lavu/log: print prefix after \r.

Should fix trac ticket #2797 because of the progress line.

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

 libavutil/log.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/log.c b/libavutil/log.c
index a4111f6..29ad2d0 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -190,8 +190,10 @@ static void format_line(void *ptr, int level, const char *fmt, va_list vl,
 
     vsnprintf(part[2], part_size, fmt, vl);
 
-    if(*part[0] || *part[1] || *part[2])
-        *print_prefix = strlen(part[2]) && part[2][strlen(part[2]) - 1] == '\n';
+    if(*part[0] || *part[1] || *part[2]) {
+        char lastc = strlen(part[2]) ? part[2][strlen(part[2]) - 1] : 0;
+        *print_prefix = lastc == '\n' || lastc == '\r';
+    }
 }
 
 void av_log_format_line(void *ptr, int level, const char *fmt, va_list vl,



More information about the ffmpeg-cvslog mailing list