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

Måns Rullgård mans
Fri Apr 23 14:36:23 CEST 2010


James Darnley <james.darnley at gmail.com> writes:

> 2010/4/23 M?ns Rullg?rd <mans at mansr.com>:
>> James Darnley <james.darnley at gmail.com> writes:
>>
>>> 2010/4/23 M?ns Rullg?rd <mans at mansr.com>:
>>>> A newline before the first 0 and normal indentation on those lines
>>>> would be nice too.
>>>
>>> Better?
>>>
>>> + ? ?if ((color&15)==9) {
>>> + ? ? ? ?fputs(str, stderr);
>>> + ? ? ? ?return;
>>> + ? ?}
>>
>> What's that all about?
>
> Did that to not require detecting the original fg (text) colour and
> then setting win_color_conv[9] to that value.  Why do that?  Because I
> don't have grey text over my black bg and I don't want half of
> ffmpeg's output in grey and the other in white.  Yes, I gave in and
> decided that I wouldn't screw people with a white bg.

I'll never understand Windows, might as well not try.

>>> + ? ?console = GetStdHandle(STD_ERROR_HANDLE);
>>> + ? ?GetConsoleScreenBufferInfo(console, &console_info);
>>> + ? ?attributes = (console_info.wAttributes&0xF0) | win_color_conv[color&15];
>>> + ? ?attributes |= (console_info.wAttributes&BACKGROUND_INTENSITY)?0:FOREGROUND_INTENSITY;
>>> + ? ?SetConsoleTextAttribute(console, attributes);
>>> + ? ?fputs(str, stderr);
>>> + ? ?SetConsoleTextAttribute(console, console_info.wAttributes);
>>
>> This slab of code is ugly.
>
> Would you like more new lines in there

More whitespace one way or another would probably help.  Maybe shorter
variable names too.

>> How does this behave in a cygwin xterm?
>
> It does nothing.

Then this patch is wrong.

-- 
M?ns Rullg?rd
mans at mansr.com



More information about the ffmpeg-cvslog mailing list