[MPlayer-dev-eng] [PATCH] -identify audio CD tracks

Guillaume POIRIER poirierg at gmail.com
Mon Sep 19 20:23:50 CEST 2005


Hi,

On 9/11/05, kiriuja <mplayer-patches at en-directo.net> wrote:
> On Sunday 11 September 2005 09:16, Guillaume POIRIER wrote:
> > This hunk doesn't seem too obvious to me, so I'd like you to comment it a bit:
> >
> > +  i = cdd_identify(p->device);
> > +  if(i >= 0) {
> >    if(strncmp(st->url,"cddb",4) == 0) {
> >      i = cddb_resolve(p->device, &xmcd_file);
> >      if(i == 0) {
> > @@ -119,6 +122,7 @@ static int open_cdda(stream_t *st,int m,
> >        free(xmcd_file);
> >      }
> >    }
> > +  }
> >
> > I don't understand why calling cdd_identify(p->device), which, as its
> > names states, just "identifies" p->device gives you information to
> > skip a part of the code.
> 
> cdd_identify returns -1 if it cannot read the TOC of the CD. In that case
> there is no point in calling cddb_resolve, because it cannot do anything
> useful without the TOC. I added the comment explaining that.
> 
> > +     if (identify)
> > +     {
> > +             int i, min, sec, frame;
> > +             cdtoc_last_track = read_toc(dev);
> > +             if (cdtoc_last_track < 0) {
> > +                     printf("Failed to open %s device.\n", dev);
> > +                     return -1;
> > +             }
> >
> > Aren't all messages supposed to use mp_msg() ? The existing code does
> > use one printf at least, but that maybe needs to be fixed later.
> 
> Yes, it should've been mp_msg. I changed it in the attached patch.
> 
> I also added ID_CDDA_TRACK=N output showing the currently played
> track number. Updated patch attached.

Comitted along with doxygen comments

Cheers,

Guillaume

-- 
Reading doesn't hurt, really!
 -- Dominik 'Rathann' Mierzejewski




More information about the MPlayer-dev-eng mailing list