[libdvdcss-devel] Using the dvdcss structure in C

Sam Hocevar sam at hocevar.net
Thu Jun 24 10:37:05 CEST 2010


On Sun, Jun 20, 2010, Fabrice DELENTE wrote:

> I'm trying to design a way to uniquely identify a DVD; I looked at the
> libdvdcss.c file and managed to retrieve the disc name and its timestamp
> that are at offset 40 and 813 on the first sector of the DVD.
> 
> libdvdcss.c seems to imply that the key is mandatory to uniquely identify a
> disc, how can I recover the key?

   libdvdcss identifies a disc with only the name and the timestamp/
serial information. If the key was needed to identify the disc, there
would be no point in caching the key... We do invalidate the cached
key if we do find out that the key does not work, but this should not
usually happen.

> printf("%.2x", dvdcss->css.p_disc_key[0] );
> 
> but gcc doesn't compile...

   This doesn't work because dvdcss_t and css_t are opaque structures.
For it to work, you would need to copy their definition from
libdvdcss.h, but that would break as soon as libdvdcss changes its
internal structures. Another solution would be if libdvdcss exported
a means to get the key. We never saw a need for that, and you don't
actually look like you really need it.

Cheers,
-- 
Sam.


More information about the libdvdcss-devel mailing list