[MPlayer-dev-eng] [PATCH] MSGT_IDENTIFY (was: option to skip slow -identify output)

Diego Biurrun diego at biurrun.de
Sat Apr 22 13:55:24 CEST 2006


On Thu, Apr 20, 2006 at 06:13:21PM -0400, kiriuja wrote:
> On Wednesday 19 April 2006 20:44 Alban Bedel wrote:
> > Personaly i would prefer to see the whole identify stuff move to mp_msg.
> > It shouldn't be too hard to have a single small hack so that -verbose and
> > -v doesn't change the level of MSGT_IDENTIFY. Then (in the long run) we
> > could get rid of all those if(indentify) that creep all over the place.
> > It would also make it trivial to have several level of identify.
> 
> Patch attached. Please check and apply before pre8 is out.

Overall the patch looks very good, it's great to get rid of all those
global variables.  I still have a few small issues, though:

>      else
> -      mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_FORMAT=%d\n", sh_audio->format);
> -    mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_BITRATE=%d\n", sh_audio->i_bps*8);
> -    mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_RATE=%d\n", sh_audio->samplerate);
> -    mp_msg(MSGT_GLOBAL,MSGL_INFO,"ID_AUDIO_NCH=%d\n", sh_audio->channels);
> +      mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_AUDIO_FORMAT=%d\n", sh_audio->format);
> +    mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_AUDIO_BITRATE=%d\n", sh_audio->i_bps*8);
> +    mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_AUDIO_RATE=%d\n", sh_audio->samplerate);
> +    mp_msg(MSGT_IDENTIFY,MSGL_INFO,"ID_AUDIO_NCH=%d\n", sh_audio->channels);

Indentation is messed up here.

> +    mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VOBSUB_ID=%d\n", index);
> +    if (id && idlen)
> +	mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_VSID_%d_LANG=%s\n", index, vob->spu_streams[index].id);
>      mp_msg(MSGT_VOBSUB,MSGL_V,"[vobsub] subtitle (vobsubid): %d language %s\n",
>  		index, vob->spu_streams[index].id);

The indentation of this block also looks wrong.

> --- libaf/af.c	13 Apr 2006 10:36:17 -0000	1.53
> +++ libaf/af.c	20 Apr 2006 18:06:41 -0000
> @@ -698,8 +698,7 @@ void af_frac_mul(frac_t *out, const frac
>  void af_help (void) {
>    int i = 0;
>    af_msg(AF_MSG_INFO, "Available audio filters:\n");
> -  if (identify)
> -    af_msg(AF_MSG_INFO, "ID_AUDIO_FILTERS\n");
> +  mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_AUDIO_FILTERS\n");

This is wrong, libaf uses af_msg, not mp_msg.

> --- libmpdemux/stream_dvd.c	14 Apr 2006 13:03:05 -0000	1.15
> +++ libmpdemux/stream_dvd.c	20 Apr 2006 18:06:46 -0000
> @@ -569,17 +569,20 @@ static int open_s(stream_t *stream,int m
>        return STREAM_UNSUPORTED;
>      }
>      tt_srpt = vmg_file->tt_srpt;
> -    if (identify)
> +    if (mp_msg_test(MSGT_IDENTIFY, MSGL_INFO))
>      {
> -      unsigned char discid [16]; ///< disk ID, a 128 bit MD5 sum
> -      int vts_no;   ///< video title set number
>        int title_no; ///< title number
> -      mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_DVD_TITLES=%d\n", tt_srpt->nr_of_srpts);
> +      mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_DVD_TITLES=%d\n", tt_srpt->nr_of_srpts);
>        for (title_no = 0; title_no < tt_srpt->nr_of_srpts; title_no++)
>        {
> -        mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_DVD_TITLE_%d_CHAPTERS=%d\n", title_no + 1, tt_srpt->title[title_no].nr_of_ptts);
> -        mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_DVD_TITLE_%d_ANGLES=%d\n", title_no + 1, tt_srpt->title[title_no].nr_of_angles);
> +        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_DVD_TITLE_%d_CHAPTERS=%d\n", title_no + 1, tt_srpt->title[title_no].nr_of_ptts);
> +        mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_DVD_TITLE_%d_ANGLES=%d\n", title_no + 1, tt_srpt->title[title_no].nr_of_angles);
>        }
> +    }
> +    if (mp_msg_test(MSGT_IDENTIFY, MSGL_V))
> +    {
> +      unsigned char discid [16]; ///< disk ID, a 128 bit MD5 sum
> +      int vts_no;   ///< video title set number

Hmm, is it necessary to move these lines around?  This is an unrelated
change IMO, you're moving some output to verbose mode.

> @@ -588,7 +591,7 @@ static int open_s(stream_t *stream,int m
>          char buf[33];
>          for (i = 0; i < 16; i ++)
>            sprintf(buf+2*i, "%02X", discid[i]);
> -        mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_DVD_DISC_ID=%s\n", buf);
> +        mp_msg(MSGT_IDENTIFY, MSGL_V, "ID_DVD_DISC_ID=%s\n", buf);

same here

Diego




More information about the MPlayer-dev-eng mailing list