[MPlayer-dev-eng] printf -> mp_msg conversion (etc.), first patches

D Richard Felker III dalias at aerifal.cx
Sat May 22 21:08:35 CEST 2004


On Sat, May 22, 2004 at 01:04:28PM -0400, The Wanderer wrote:
> I'm going through the source and doing two things: first, changing any
> non-commented printf to an mp_msg (using MSGL_FIXME and MSGT_FIXME in
> almost every case), and second (per request), moving any translatable
> printed text from the source files themselves to help_mp-en.h so the
> translators can find it. The attached patches, to Monday afternoon's CVS
> but identical to patches against today's (and hopefully in the correct
> form), do this for mencoder.c; patches for other files will follow as I
> complete them.
> 
> I may have gone overboard somewhat with the latter type of change; some
> of the things I've moved may not need translating. Please do object to

Yes, a bit. See below.

> any change you think doesn't make sense; please also speak up if any of
> the MSGTR names I've used aren't appropriate. I should probably have
> separated the two sets of changes into different patches, but that
> didn't occur to me until I was more than halfway through. I can do it if
> necessary, but it would require essentially starting from scratch.
> 
> The first patch adds the necessary #defines to mp_msg.h.

Looks fine.

> The second patch defines the new MSGTRs in help_mp-en.h.

IMO there are a few too many. If the original string has no
grammatical content in English, just stuff like foo=%d, there's no
sense in making it translatable. Keep in mind that having the strings
outside the actual code makes it harder to understand what the
different arguments to the format string are used for...

> The third patch removes all functional printfs from mencoder.c.

Agree, except IMO you shouldn't change fprintf(stderr, ...) to
MSGL_ERROR. Just use MSGL_FIXME like everything else.

> The fourth patch keeps mplayer.c from breaking on a syntax change in
> MSGTR_Exiting.
> 
> Added from later "attention?" post: are there any files, aside from
> obvious ones like mp_msg.c, in which printf should *not* be changed to
> mp_msg? If so, which ones?

There're a couple of cases in libmpcodecs/pullup.c which should not be
changed, since it's not supposed to depend on MPlayer. They're only
used if verbose-flag is set, so they're not evil like most of the
other printf's. Still, I'll fix them later by adding a debug-callback
to pullup.

Rich




More information about the MPlayer-dev-eng mailing list