[MPlayer-dev-eng] [PATCH] -identify DVD titles

Rich Felker dalias at aerifal.cx
Tue Sep 20 00:51:19 CEST 2005


On Tue, Sep 20, 2005 at 12:41:00AM +0200, Ivo wrote:
> On Tuesday 20 September 2005 00:17, kiriuja wrote:
> > On 9/19/05, Guillaume POIRIER wrote:
> > > +      if (DVDDiscID(dvd, discid) >= 0)
> > > +        mp_msg(MSGT_GLOBAL, MSGL_INFO,
> > > "ID_DVD_DISC_ID=%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02
> > >X%02X%02X\n", +          discid[0], discid[1], discid[2], discid[3],
> > > discid[4], discid[5], discid[6], discid[7],
> > > +          discid[8], discid[9], discid[10], discid[11], discid[12],
> > > discid[13], discid[14], discid[15]);
> > >
> > > Good Lord! Isn't there a  cleaner way to print the disk ID of the DVD?
> >
> > Can't think of any shorter or more elegant way to do this in plain C.
> > Don't want to call sprintf 17 times.
> 
> How about:
> 
> "ID_DVD_DISC_ID=%016LX%016LX\n",
> bswap_64(*(uint64_t *)discid), bswap_64(*(uint64_t *)&discid[8]) );
> 
> Or is that considered equally ugly? :)

At least as ugly, and incorrect.

Rich




More information about the MPlayer-dev-eng mailing list