[FFmpeg-devel] [PATCH v3 1/3] avutil/log: rename and initialize global log flags variable

Tobias Rapp t.rapp at noa-archive.com
Wed Mar 28 18:03:38 EEST 2018


Rename global variable for symmetry with av_log_level.

Signed-off-by: Tobias Rapp <t.rapp at noa-archive.com>
---
 libavutil/log.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/libavutil/log.c b/libavutil/log.c
index 9b7d484..0a99d01 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -52,7 +52,7 @@ static AVMutex mutex = AV_MUTEX_INITIALIZER;
 #endif
 
 static int av_log_level = AV_LOG_INFO;
-static int flags;
+static int av_log_flags = 0;
 
 #define NB_LEVELS 8
 #if defined(_WIN32) && HAVE_SETCONSOLETEXTATTRIBUTE
@@ -268,7 +268,7 @@ static void format_line(void *avcl, int level, const char *fmt, va_list vl,
         if(type) type[1] = get_category(avcl);
     }
 
-    if (*print_prefix && (level > AV_LOG_QUIET) && (flags & AV_LOG_PRINT_LEVEL))
+    if (*print_prefix && (level > AV_LOG_QUIET) && (av_log_flags & AV_LOG_PRINT_LEVEL))
         av_bprintf(part+2, "[%s] ", get_level_str(level));
 
     av_vbprintf(part+3, fmt, vl);
@@ -325,7 +325,7 @@ 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) &&
+    if (print_prefix && (av_log_flags & AV_LOG_SKIP_REPEATED) && !strcmp(line, prev) &&
         *line && line[strlen(line) - 1] != '\r'){
         count++;
         if (is_atty == 1)
@@ -389,12 +389,12 @@ void av_log_set_level(int level)
 
 void av_log_set_flags(int arg)
 {
-    flags = arg;
+    av_log_flags = arg;
 }
 
 int av_log_get_flags(void)
 {
-    return flags;
+    return av_log_flags;
 }
 
 void av_log_set_callback(void (*callback)(void*, int, const char*, va_list))
-- 
2.7.4




More information about the ffmpeg-devel mailing list