[MPlayer-dev-eng] [PATCH] -identify DVD titles
Joey Parrish
joey at nicewarrior.org
Wed Sep 21 01:31:57 CEST 2005
On Tue, Sep 20, 2005 at 05:45:19PM -0400, kiriuja wrote:
> Updated patch.
>
> - Added doxygen comments per Guillaume's suggestions.
> - Fixed framerate application in dvdtimetomsec.
>
> I did not change the way disk ID is output, since the only real alternative
> is to allocate another buffer and put sprintf in a for loop, which is not
> any better than the current way IMHO.
I believe I have a better solution.
> + unsigned char discid [16]; ///< disk ID, a 128 bit MD5 sum
[ ... ]
> + 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%02X%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]);
> + }
Try this:
#include "bswap.h"
[ ... ]
uint32_t discid[4]; ///< disk ID, a 128 bit MD5 sum
[ ... ]
if (DVDDiscID(dvd, (unsigned char *)discid))
mp_msg(MSGT_GLOBAL, MSGL_INFO, "ID_DVD_DISC_ID=%08x%08x%08x%08x\n",
be2me_32(discid[0]), be2me_32(discid[1]), be2me_32(discid[2]), be2me_32(discid[3]));
I may have gotten the byteswapping wrong, so try le2me_32 as well.
Cola me if I screwed up something else.
--Joey
--
"The Hell Law says that Hell is reserved exclusively for them that believe
in it. Further, the lowest Rung in Hell is reserved for them that believe
in it on the supposition that they'll go there if they don't."
HBT; The Gospel According to Fred, 3:1
More information about the MPlayer-dev-eng
mailing list