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

James Darnley james.darnley
Fri Apr 23 11:22:29 CEST 2010


On 23 April 2010 09:59, Michael Niedermayer <michaelni at gmx.at> wrote:
>> +#ifdef _WIN32
>> +#include <windows.h>
>> +#else
>> ?#include <unistd.h>
>> +#endif
>
> unistd.h needs to be under ifdef?

Not really, but it isn't used on Windows with the current code.

>> @@ -39,6 +43,26 @@
>>
>> ?#undef fprintf
>> ?static void colored_fputs(int color, const char *str){
>> +#ifdef _WIN32
>> + ? ?int win_color_conv[] = { 0,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_RED|FOREGROUND_INTENSITY,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_GREEN|FOREGROUND_INTENSITY,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_INTENSITY,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_BLUE|FOREGROUND_INTENSITY,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_RED|FOREGROUND_BLUE|FOREGROUND_INTENSITY,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_INTENSITY,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE,
>> + ? ? ? ? ? ? ? ? ? ? ? ? ? ? FOREGROUND_RED|FOREGROUND_GREEN|FOREGROUND_BLUE };
>
> these could be vertically aligned
> also the last 3 will not make users happy on white background i suspect
> isnt there some kind of "default" text color?

Uh... they are aligned, with the 0 that is.

I can get the original text colour and the original bg colour.  But
then I wonder how many people change the colours of cmd.exe.  They are
only persistent if you use a shortcut or explicitly set them when
running it.  These functions don't seem to work with other terminals.
msys' rxvt, cygwin's mintty and even their default ones, sh run
through cmd, only respond to the ansi codes.

If someone uses another terminal on windows, please email me.



More information about the ffmpeg-cvslog mailing list