[MPlayer-dev-eng] Correcting printf to mp_msg

D Richard Felker III dalias at aerifal.cx
Sat Feb 7 03:26:08 CET 2004


On Fri, Feb 06, 2004 at 09:01:13PM -0500, The Wanderer wrote:
> 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.

Huh? Apparently you don't understand CVS. Just copy the libavcodec
tree from ffmpeg cvs under the main mplayer dir, and "cvs update" will
automatically update it, keeping your changes. Removing it and
replacing it with a new copy from somewhere else every time makes
absolutely no sense.

Anyway, if you make the patch for libavcodec, I'll apply it.

> >>>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.

You could even just add //FIXME to the end of the line and use normal
MSGL's, but that might not be as clear/noticable for people wanting to
fix the levels in the future. IMO a single MSGL_FIXME is fine though.

Rich




More information about the MPlayer-dev-eng mailing list