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

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Sun Oct 31 12:08:10 CET 2004


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

>  void print_wave_header(WAVEFORMATEX *h){
> -  printf("======= WAVE Format =======\n");
> -  printf("Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
> -  printf("Channels: %d\n",h->nChannels);
> -  printf("Samplerate: %ld\n",h->nSamplesPerSec);
> -  printf("avg byte/sec: %ld\n",h->nAvgBytesPerSec);
> -  printf("Block align: %d\n",h->nBlockAlign);
> -  printf("bits/sample: %d\n",h->wBitsPerSample);
> -  printf("cbSize: %d\n",h->cbSize);
> +  mp_msg(MSGT_HEADER, MSGL_V, "======= WAVE Format =======\n");
> +  mp_msg(MSGT_HEADER, MSGL_V, "Format Tag: %d (0x%X)\n",h->wFormatTag,h->wFormatTag);
> +  mp_msg(MSGT_HEADER, MSGL_V, "Channels: %d\n",h->nChannels);
> +  mp_msg(MSGT_HEADER, MSGL_V, "Samplerate: %ld\n",h->nSamplesPerSec);
> +  mp_msg(MSGT_HEADER, MSGL_V, "avg byte/sec: %ld\n",h->nAvgBytesPerSec);
> +  mp_msg(MSGT_HEADER, MSGL_V, "Block align: %d\n",h->nBlockAlign);
> +  mp_msg(MSGT_HEADER, MSGL_V, "bits/sample: %d\n",h->wBitsPerSample);
> +  mp_msg(MSGT_HEADER, MSGL_V, "cbSize: %d\n",h->cbSize);
>    if(h->wFormatTag==0x55 && h->cbSize>=12){
>        MPEGLAYER3WAVEFORMAT* h2=(MPEGLAYER3WAVEFORMAT *)h;
> -      printf("mp3.wID=%d\n",h2->wID);
> -      printf("mp3.fdwFlags=0x%lX\n",h2->fdwFlags);
> -      printf("mp3.nBlockSize=%d\n",h2->nBlockSize);
> -      printf("mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
> -      printf("mp3.nCodecDelay=%d\n",h2->nCodecDelay);
> +      mp_msg(MSGT_HEADER, MSGL_V, "mp3.wID=%d\n",h2->wID);
> +      mp_msg(MSGT_HEADER, MSGL_V, "mp3.fdwFlags=0x%lX\n",h2->fdwFlags);
> +      mp_msg(MSGT_HEADER, MSGL_V, "mp3.nBlockSize=%d\n",h2->nBlockSize);
> +      mp_msg(MSGT_HEADER, MSGL_V, "mp3.nFramesPerBlock=%d\n",h2->nFramesPerBlock);
> +      mp_msg(MSGT_HEADER, MSGL_V, "mp3.nCodecDelay=%d\n",h2->nCodecDelay);
>    }
>    else if (h->cbSize > 0)
>    {
>      int i;
>      uint8_t* p = ((uint8_t*)h) + sizeof(WAVEFORMATEX);
> -    printf("Unknown extra header dump: ");
> +    mp_msg(MSGT_HEADER, MSGL_V, "Unknown extra header dump: ");
>      for (i = 0; i < h->cbSize; i++)
> -	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?

> -  mp_msg(MSGT_CPLAYER,MSGL_INFO, "MPlayer " VERSION " (C) 2000-2004 MPlayer Team\n\n");
> +  mp_msg(MSGT_CPLAYER,MSGL_INFO, "MPlayer " VERSION " (C) 2000-2004 MPlayer Team\n");

> -  mp_msg(MSGT_CPLAYER,MSGL_INFO, "MEncoder " VERSION " (C) 2000-2004 MPlayer Team\n\n");
> +  mp_msg(MSGT_CPLAYER,MSGL_INFO, "MEncoder " VERSION " (C) 2000-2004 MPlayer Team\n");

I'm not so sure if removing the newlines is such a good idea... It might
make reading/finding things more difficult...

> --- cfg-mencoder.h	21 Sep 2004 19:45:49 -0000	1.89
> +++ cfg-mencoder.h	7 Oct 2004 01:12:08 -0000
> @@ -87,7 +87,7 @@
>  	{"qtvideo", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_QTVIDEO, NULL},
>  	{"nuv", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_NUV, NULL},
>  	{"x264", &out_video_codec, CONF_TYPE_FLAG, 0, 0, VCODEC_X264, NULL},
> -	{"help", "\nAvailable codecs:\n"
> +	{"help", "Available codecs:\n"
>  	"   copy     - frame copy, without re-encoding. Doesn't work with filters.\n"
>  	"   frameno  - special audio-only file for 3-pass encoding, see DOCS.\n"
>  	"   raw      - uncompressed video. Use fourcc option to set format explicitly.\n"
> @@ -137,7 +137,7 @@
>  #else
>  	{"toolame", "MPlayer was compiled without libtoolame. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
>  #endif
> -	{"help", "\nAvailable codecs:\n"
> +	{"help", "Available codecs:\n"
>  	"   copy     - frame copy, without re-encoding (useful for AC3)\n"
>  	"   pcm      - uncompressed PCM audio\n"
>  #ifdef HAVE_MP3LAME
> @@ -161,7 +161,7 @@
>  	{"copyright", &info_copyright, CONF_TYPE_STRING, 0, 0, 0, NULL},
>  	{"srcform", &info_sourceform, CONF_TYPE_STRING, 0, 0, 0, NULL},
>  	{"comment", &info_comment, CONF_TYPE_STRING, 0, 0, 0, NULL},
> -	{"help", "\nAvailable INFO fields:\n"
> +	{"help", "Available INFO fields:\n"
>  	"   name      - title of the work\n"
>  	"   artist    - artist or author of the work\n"
>  	"   genre     - original work category\n"
> @@ -177,7 +177,7 @@
>  	{"avi", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_AVI, NULL},
>  	{"mpeg", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_MPEG, NULL},
>  	{"rawvideo", &out_file_format, CONF_TYPE_FLAG, 0, 0, MUXER_TYPE_RAWVIDEO, NULL},
> -	{"help", "\nAvailable output formats:\n"
> +	{"help", "Available output formats:\n"
>  	"   avi      - Microsoft Audio/Video Interleaved\n"
>  	"   mpeg     - MPEG-1 system stream format\n"
>  	"   rawvideo - (video only, one stream only) raw stream, no muxing\n"

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)


> Index: libvo/x11_common.c
> ===================================================================
> RCS file: /cvsroot/mplayer/main/libvo/x11_common.c,v
> retrieving revision 1.176
> diff -u -r1.176 x11_common.c
> --- libvo/x11_common.c	8 Aug 2004 23:22:04 -0000	1.176
> +++ libvo/x11_common.c	9 Oct 2004 19:44:40 -0000
> @@ -1626,7 +1627,7 @@
>                  DPMSInfo(mDisplay, &state, &onoff);
>                  if (onoff)
>                  {
> -                    mp_msg(MSGT_VO, MSGL_INFO,
> +                    mp_msg(MSGT_VO, MSGL_V,
>                             "Successfully enabled DPMS\n");
>                  } else
>                  {

You should at least keep it consistent with the disabled message, line 1684 or is this intended to be like this?

Greetings,
Reimar Döffinger




More information about the MPlayer-dev-eng mailing list