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

kiriuja mplayer-patches at en-directo.net
Sat Apr 22 14:44:32 CEST 2006


On Saturday 22 April 2006 07:55 Diego Biurrun wrote:
> On Thu, Apr 20, 2006 at 06:13:21PM -0400, kiriuja wrote:
> > -      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.

How exactly? It preserves the existing indentation.

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

Again, how exactly? It uses the exact same indentation as the surrounding
code (notice a memcpy a few lines above?).

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

af_msg is nothing but #define for mp_msg(MSGT_AFILTER, ...), so if I want
to pass another MSGT, I have to use mp_msg directly.

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

Yes, it is necessary, as discussed previously. This is the whole point
of the patch.

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

Same as above.

--
kiriuja




More information about the MPlayer-dev-eng mailing list