[MPlayer-dev-eng] [PATCH] reduce verbosity in some places

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Nov 8 20:13:21 CET 2004


Hi,

On Mon, Nov 08, 2004 at 01:37:23AM +0100, Diego Biurrun wrote:
> Reimar Döffinger writes:
> >  
> > > I've had these changes lying in my local tree for some time which move
> > > some messages to verbose mode, cutting down a bit on MPlayer's
> > > verbosity.
> > > 
> > > If nobody objects I will apply this soon.
> > 
> > > -	printf("[%x] ", p[i]);
> > > -    printf("\n");
> > > +	mp_msg(MSGT_HEADER, MSGL_V, "[%x] ", p[i]);
> > > +    mp_msg(MSGT_HEADER, MSGL_V, "\n");
> > >    }
> > > -  printf("===========================\n");
> > > +  mp_msg(MSGT_HEADER, MSGL_V, "==========================================================================\n");
> > >  }
> > 
> > There is a check for the verbosity level at the place where this
> > function is called... I would prefer if this checking would be done in
> > only one place... Maybe allow a level parameter when calling this
> > function? What do the others think?
> 
> What exactly do you have in mind?

Well, you could add a new parameter to that function like msg_lvl, that
you could set to e.g. MSGL_V or MSGL_DBG2 or MSGL_INFO.
Another possibility would be to remove the verbosity level check at the point
where it is called, so it is always printed when verbose >= 1,
regardless of who calls the function.
Maybe the later is better (although less flexible), but I do not know.

> > Instead of removing the newlines at the beginning I'd actually prefer to
> > have some for -ac help -vc help etc...
> > For those the output looks like this, it all hangs together far to much
> > for my taste...
> > 
> > > Reading config file /etc/mplayer/mplayer.conf
> > > Reading config file /home/reimar/.mplayer/config
> > > Reading /home/reimar/.mplayer/codecs.conf: 77 audio & 181 video codecs
> > > Available video codecs:
> > > vc:         vfm:      status:   info:  [lib/dll]
> > > mpegpes     mpegpes   working   Mpeg PES output (.mpg or Dxr3/DVB card)
> > > mpeg12      libmpeg2  working   MPEG 1 or 2 (libmpeg2)
> 
> Just look what my local tree prints:
> 
> silver:/usr/src/mplayer/dev$ ./mplayer -ac help
> MPlayer dev-CVS-041009-21:35-3.3.4 (C) 2000-2004 MPlayer Team
> 
> Available audio codecs:
> ac:         afm:      status:   info:  [lib/dll]
> wma9dmo     dmo       working   Windows Media Audio 9 DMO  [wma9dmod.dll]
> wmadmo      dmo       working   Windows Media Audio DMO  [wmadmod.dll]
> 
> :-)

Well, but it just works by chance I think... If there should be a
newline before the "Available audio codecs" then the \n should also be
in the beginning of that string... Less risk of breaking when changing
things.
Also, this is almost a bit too much stripped down for my taste.
Anyway, documentation is in your responsibility and I consider that
documentation ;-)

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list