# HG changeset patch # User jkeil # Date 1000058570 0 # Node ID 73c77105006566bec13b64916c8830a80b4e2a1f # Parent d7ee8628f1d56ee6384bad2e5572cff71eae4483 Add support for libdvdread-0.9.0 diff -r d7ee8628f1d5 -r 73c771050065 configure --- a/configure Sun Sep 09 07:27:23 2001 +0000 +++ b/configure Sun Sep 09 18:02:50 2001 +0000 @@ -943,7 +943,6 @@ #include #include #include -#include #include int main( void ) { return 0; } EOF diff -r d7ee8628f1d5 -r 73c771050065 open.c --- a/open.c Sun Sep 09 07:27:23 2001 +0000 +++ b/open.c Sun Sep 09 18:02:50 2001 +0000 @@ -31,9 +31,22 @@ #include #include #include -#include #include -//#include + +#define DVDREAD_VERSION(maj,min,micro) ((maj)*10000 + (min)*100 + (micro)) + +/* + * Try to autodetect the libdvd-0.9.0 library + * (0.9.0 removed the header, and moved the two defines + * DVD_VIDEO_LB_LEN and MAX_UDF_FILE_NAME_LEN from it to + * ) + */ +#if defined(DVD_VIDEO_LB_LEN) && defined(MAX_UDF_FILE_NAME_LEN) +#define LIBDVDREAD_VERSION DVDREAD_VERSION(0,9,0) +#else +#define LIBDVDREAD_VERSION DVDREAD_VERSION(0,8,0) +#endif + typedef struct { dvd_reader_t *dvd; @@ -351,7 +364,11 @@ if(data[38]==0 && data[39]==0 && data[40]==1 && data[41]==0xBF && data[1024]==0 && data[1025]==0 && data[1026]==1 && data[1027]==0xBF){ // found a Navi packet!!! +#if LIBDVDREAD_VERSION >= DVDREAD_VERSION(0,9,0) + navRead_DSI( &d->dsi_pack, &(data[ DSI_START_BYTE ]) ); +#else navRead_DSI( &d->dsi_pack, &(data[ DSI_START_BYTE ]), sizeof(dsi_t) ); +#endif if(d->cur_pack != d->dsi_pack.dsi_gi.nv_pck_lbn ){ mp_msg(MSGT_DVD,MSGL_V, "Invalid NAVI packet! lba=0x%X navi=0x%X \n", d->cur_pack,d->dsi_pack.dsi_gi.nv_pck_lbn);