[SCM] libav/experimental: Allow to force colored output.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 17:19:43 UTC 2013


The following commit has been merged in the experimental branch:
commit 129983408d0d064db656742a3d3d4c038420f48c
Author: Etienne Buira <etienne.buira.lists at free.fr>
Date:   Sun Dec 5 13:56:49 2010 +0000

    Allow to force colored output.
    
    Patch by Etienne Buira, etienne d buira d lists a free d fr
    
    Originally committed as revision 25888 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/doc/fftools-common-opts.texi b/doc/fftools-common-opts.texi
index 618441e..7f192f7 100644
--- a/doc/fftools-common-opts.texi
+++ b/doc/fftools-common-opts.texi
@@ -84,6 +84,7 @@ Set the logging level used by the library.
 
 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
diff --git a/libavutil/log.c b/libavutil/log.c
index 0fd7c96..1975bab 100644
--- a/libavutil/log.c
+++ b/libavutil/log.c
@@ -62,9 +62,9 @@ static void colored_fputs(int level, const char *str){
             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
     }
 

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list