[FFmpeg-cvslog] r25888 - in trunk: doc/fftools-common-opts.texi libavutil/log.c

cehoyos subversion
Sun Dec 5 14:56:49 CET 2010


Author: cehoyos
Date: Sun Dec  5 14:56:49 2010
New Revision: 25888

Log:
Allow to force colored output.

Patch by Etienne Buira, etienne d buira d lists a free d fr

Modified:
   trunk/doc/fftools-common-opts.texi
   trunk/libavutil/log.c

Modified: trunk/doc/fftools-common-opts.texi
==============================================================================
--- trunk/doc/fftools-common-opts.texi	Sun Dec  5 12:45:57 2010	(r25887)
+++ trunk/doc/fftools-common-opts.texi	Sun Dec  5 14:56:49 2010	(r25888)
@@ -84,6 +84,7 @@ Set the logging level used by the librar
 
 By default the program logs to stderr, if coloring is supported by the
 terminal, colors are used to mark errors and warnings. Log coloring
-can be disabled setting the environment variable @env{NO_COLOR}.
+can be disabled setting the environment variable @env{NO_COLOR}, or can
+be forced setting the environment variable @env{FFMPEG_FORCE_COLOR}.
 
 @end table

Modified: trunk/libavutil/log.c
==============================================================================
--- trunk/libavutil/log.c	Sun Dec  5 12:45:57 2010	(r25887)
+++ trunk/libavutil/log.c	Sun Dec  5 14:56:49 2010	(r25888)
@@ -62,9 +62,9 @@ static void colored_fputs(int level, con
             background = attr_orig & 0xF0;
         }
 #elif HAVE_ISATTY
-        use_color= getenv("TERM") && !getenv("NO_COLOR") && isatty(2);
+        use_color= !getenv("NO_COLOR") && (getenv("TERM") && isatty(2) || getenv("FFMPEG_FORCE_COLOR"));
 #else
-        use_color= 0;
+        use_color= getenv("FFMPEG_FORCE_COLOR") && !getenv("NO_COLOR");
 #endif
     }
 



More information about the ffmpeg-cvslog mailing list