Message ID | 1522249420-5373-1-git-send-email-t.rapp@noa-archive.com |
---|---|
State | New |
Headers | show |
On Wed, Mar 28, 2018 at 05:03:38PM +0200, Tobias Rapp wrote: > Rename global variable for symmetry with av_log_level. > > Signed-off-by: Tobias Rapp <t.rapp@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; This prefix is confusing as the av prefix is intended for exported public symbols which a static symbol cannot be [...]
On 29.03.2018 20:40, Michael Niedermayer wrote: > On Wed, Mar 28, 2018 at 05:03:38PM +0200, Tobias Rapp wrote: >> Rename global variable for symmetry with av_log_level. >> >> Signed-off-by: Tobias Rapp <t.rapp@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; > > This prefix is confusing as the av prefix is intended for > exported public symbols which a static symbol cannot be Stumbled over the generic name of this global variable when working on the av_log_set_opts function. As that patch is dropped I consider this patch as irrelevant. Regards, Tobias
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))
Rename global variable for symmetry with av_log_level. Signed-off-by: Tobias Rapp <t.rapp@noa-archive.com> --- libavutil/log.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)