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

Ivo ivop at euronet.nl
Tue Sep 20 00:41:00 CEST 2005


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? :)

--Ivo




More information about the MPlayer-dev-eng mailing list