summaryrefslogtreecommitdiff
path: root/libavutil/log.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-07-19 15:32:25 +0200
committerNicolas George <nicolas.george@normalesup.org>2013-07-20 11:06:19 +0200
commitc25d1ba55636504c2b6a9c6987cf4c80fdc7091c (patch)
tree3fef59eb3a540498312d2cb49680fdb1ba92df3e /libavutil/log.c
parentb67401797e4e51c0fdc0978d2219ac3703403a85 (diff)
downloadffmpeg-c25d1ba55636504c2b6a9c6987cf4c80fdc7091c.tar.gz
lavu/log: print prefix after \r.
Should fix trac ticket #2797 because of the progress line.
Diffstat (limited to 'libavutil/log.c')
-rw-r--r--libavutil/log.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavutil/log.c b/libavutil/log.c
index a4111f6274..29ad2d0c28 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,