[MPlayer-dev-eng] Correcting printf to mp_msg
The Wanderer
inverseparadox at comcast.net
Sat Feb 7 03:01:13 CET 2004
D Richard Felker III wrote:
> On Fri, Feb 06, 2004 at 05:51:14PM -0500, The Wanderer wrote:
>> Should the printf() calls be changed in things like libavcodec,
>> libfaad2, mp3lib and so forth?
>
> Yes, most certainly! Any lib that calls printf is just plain broken.
> stdout does not belong to libs!!
Agreed, but:
>> I'd be reluctant to do it with libavcodec,
>
> It should have already been done with lavc (changing printf to
> av_log). If there are left-over printf's, they should be changed
> asap. MPlayer should implement av_log with a call to mp_msg at the
> appropriate level(s).
The trouble with this is that some people, myself included, routinely
update libavcodec from its CVS and use the result to replace the
libavcodec directory under the MPlayer source tree - meaning that any
correction of the printf()s to av_log()s would be lost. I'd rather see
the corrections made in libavcodec CVS, which I suppose I could do, but
I'd have to subscribe to their mailing list and get the OK there... and
I'm shy.
>>> If you do blind s&r now, it would work ok, but then later on when
>>> someone wants to fix the message levels, it'll be difficult to
>>> figure out which messages already have intentionally-assigned
>>> levels and which don't.
>>
>> Adam Rice's suggestion of defining FIXME_MESSAGE_LEVEL seems like a
>> workable solution to this; even if whoever changes the original
>> printf() doesn't intend to do blind search-and-replace, it could be
>> useful if he or she (or me) gets lazy.
>
> Agreed!
What MSGL_ should FIXME_MESSAGE_LEVEL (or MSGL_FIXME?) be equivalent to?
5 (STATUS, verbose level 0), because that's the level at which they
would be output if left unchanged? Or should there be a complete set of
FIXME defines, one for each message level, for versatility?
The latter feels like going overboard, but otherwise I can't specify
different message levels without hiding from later review the fact that
the level was chosen by someone who doesn't necessarily know what he's
talking about.
--
The Wanderer
A government exists to serve its citizens, not to control them.
More information about the MPlayer-dev-eng
mailing list