Commit a1c027e9 authored by Ramiro Polla's avatar Ramiro Polla

Rename use_ansi_color to use_color so it is not ANSI-specific.

Originally committed as revision 23552 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 65db0587
...@@ -34,23 +34,23 @@ static ...@@ -34,23 +34,23 @@ static
#endif #endif
int av_log_level = AV_LOG_INFO; int av_log_level = AV_LOG_INFO;
static int use_ansi_color=-1; static int use_color=-1;
#undef fprintf #undef fprintf
static void colored_fputs(int color, const char *str){ static void colored_fputs(int color, const char *str){
if(use_ansi_color<0){ if(use_color<0){
#if HAVE_ISATTY && !defined(_WIN32) #if HAVE_ISATTY && !defined(_WIN32)
use_ansi_color= getenv("TERM") && !getenv("NO_COLOR") && isatty(2); use_color= getenv("TERM") && !getenv("NO_COLOR") && isatty(2);
#else #else
use_ansi_color= 0; use_color= 0;
#endif #endif
} }
if(use_ansi_color){ if(use_color){
fprintf(stderr, "\033[%d;3%dm", color>>4, color&15); fprintf(stderr, "\033[%d;3%dm", color>>4, color&15);
} }
fputs(str, stderr); fputs(str, stderr);
if(use_ansi_color){ if(use_color){
fprintf(stderr, "\033[0m"); fprintf(stderr, "\033[0m");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment