diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-09-24 15:37:01 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-09-24 15:37:01 +0000 |
commit | 1c1c80f0a3157278bf66da98e194729cdeea6631 (patch) | |
tree | 5632ed66669858c08d12f4175264d108a6a40cde /libavutil/log.c | |
parent | 7e117771cdf6ed76c90455ce289dbd027477b7fb (diff) | |
download | ffmpeg-1c1c80f0a3157278bf66da98e194729cdeea6631.tar.gz |
2nd try to fix av_log() repeated detection
Originally committed as revision 25174 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavutil/log.c')
-rw-r--r-- | libavutil/log.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavutil/log.c b/libavutil/log.c index 2e95068db3..ec16c67ad8 100644 --- a/libavutil/log.c +++ b/libavutil/log.c @@ -33,6 +33,7 @@ static #endif int av_log_level = AV_LOG_INFO; +static int flags; #if defined(_WIN32) && !defined(__MINGW32CE__) #include <windows.h> @@ -109,8 +110,9 @@ void av_log_default_callback(void* ptr, int level, const char* fmt, va_list vl) if(!detect_repeats) detect_repeats= isatty(2) ? 1 : -1; #endif - if(print_prefix && detect_repeats==1 && !strcmp(line, prev)){ + if(print_prefix && (flags & AV_LOG_SKIP_REPEATED) && !strcmp(line, prev)){ count++; + if(detect_repeats==1) fprintf(stderr, " Last message repeated %d times\r", count); return; } @@ -150,6 +152,11 @@ void av_log_set_level(int level) av_log_level = level; } +void av_log_set_flags(int arg) +{ + flags= arg; +} + void av_log_set_callback(void (*callback)(void*, int, const char*, va_list)) { av_log_callback = callback; |