Mercurial > libavutil.hg
diff log.c @ 1019:4a16166d580e libavutil
2nd try to fix av_log() repeated detection
author | michael |
---|---|
date | Fri, 24 Sep 2010 15:37:01 +0000 |
parents | fd2dd26fab8a |
children | d5c1288962a1 |
line wrap: on
line diff
--- a/log.c Tue Sep 14 14:45:43 2010 +0000 +++ b/log.c Fri Sep 24 15:37:01 2010 +0000 @@ -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 @@ 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 @@ 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;