[FFmpeg-cvslog] r22948 - trunk/libavutil/log.c

Stefano Sabatini stefano.sabatini-lala
Fri Apr 23 00:44:26 CEST 2010


On date Thursday 2010-04-22 22:39:35 +0200, michael wrote:
> Author: michael
> Date: Thu Apr 22 22:39:34 2010
> New Revision: 22948
> 
> Log:
> Disable ANSI color code until we figured out how to detect ANSI support in
> the used terminal.
> 
> Modified:
>    trunk/libavutil/log.c
> 
> Modified: trunk/libavutil/log.c
> ==============================================================================
> --- trunk/libavutil/log.c	Thu Apr 22 22:34:30 2010	(r22947)
> +++ trunk/libavutil/log.c	Thu Apr 22 22:39:34 2010	(r22948)
> @@ -40,11 +40,11 @@ int av_log_level = AV_LOG_INFO;
>  #undef fprintf
>  static void colored_fputs(int color, const char *str){
>      if(isatty(2)){
> -        fprintf(stderr, "\033[%dm\033[3%dm", color>>4, color&15);
> +//        fprintf(stderr, "\033[%dm\033[3%dm", color>>4, color&15);
>      }
>      fputs(str, stderr);
>      if(isatty(2)){
> -        fprintf(stderr, "\033[0m");
> +  //      fprintf(stderr, "\033[0m");
>      }
>  }

I suggest to check how git resolves the problem, it supports ANSI
colors and I'm pretty confident git developers know what they do (yes
I'm a git fan ;-)).

But also should be possible to disable ANSI sequences either
configuration-time either run-time, I mean an option of the kind
--no-ansi-colors.

ANSI colors usually work well only with black on white or white on
black, don't expect to be able to read errors if you're freak enough
to use yellow on red, especially I don't want to put trouble on people
with very specific capabilities / requirements (e.g. visually
impaired).

We may implement high contrast color computation algorithms but that
would look quite overkill just for fixing this problem (well maybe
putting something in libavfilter...).

Regards.



More information about the ffmpeg-cvslog mailing list