--- xine-lib-1.1.10/src/input/libdvdnav/dvd_input.c_original 2008-02-03 15:44:53.000000000 +1300 +++ xine-lib-1.1.10/src/input/libdvdnav/dvd_input.c_original 2008-02-03 15:57:51.000000000 +1300 @@ -409,6 +409,12 @@ } #endif /* HAVE_DVDCSS_DVDCSS_H */ + /* libdvdread_udf.patch start */ + fprintf(stderr, "libdvdread patched to play DVDs with DVD-Movie-Protect by Seby\n"); + fprintf(stderr, "With help from: http://tobias.rautenkranz.ch/libdvdread_ifo.html\n"); + /* libdvdread_udf.patch end */ + + if(dvdcss_library != NULL) { /* char *psz_method = getenv( "DVDCSS_METHOD" ); --- xine-lib-1.1.10/src/input/libdvdnav/dvd_udf.c_original 2008-02-03 15:49:41.000000000 +1300 +++ xine-lib-1.1.10/src/input/libdvdnav/dvd_udf.c_original 2008-02-03 15:57:22.000000000 +1300 @@ -42,6 +42,12 @@ #include "dvd_reader.h" #include "dvd_udf.h" +/* libdvdread_udf.patch start */ +#include "ifo_types.h" +#include "ifo_read.h" +#include +/* libdvdread_udf.patch end */ + /* Private but located in/shared with dvd_reader.c */ extern int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number, size_t block_count, unsigned char *data, @@ -777,6 +783,80 @@ uint32_t UDFFindFile( dvd_reader_t *device, char *filename, uint32_t *filesize ) { + /* libdvdread_udf.patch start */ + uint32_t offset=0; +#ifndef __WIN32__ + if (!fnmatch("/VIDEO_TS/VTS_[0-9][0-9]_[0-9].???", filename, FNM_PATHNAME)) { +#else + if (strlen("/VIDEO_TS/VTS_01_1.VOB") == strlen(filename) + && !strncmp(filename, "/VIDEO_TS/VTS_", strlen("/VIDEO_TS/VTS_")) ) { +#endif + size_t len = strlen(filename); + char *extension = &filename[len-3]; + if (!strcmp(extension, "IFO") || !strcmp(extension, "VOB")) { + int title = atoi(&filename[len-8]); + int part = atoi(&filename[len-5]); + + ifo_handle_t *ifo_handle = ifoOpen(device, 0); + if (0 == ifo_handle) + return 0; + + if (title > ifo_handle->tt_srpt->nr_of_srpts) { + ifoClose(ifo_handle); + return 0; + + } + + uint32_t tmp_filesize; + offset += UDFFindFile(device, "/VIDEO_TS/VIDEO_TS.IFO", &tmp_filesize); + + + int i; + for (i=0; itt_srpt->nr_of_srpts; i++) + if (title == ifo_handle->tt_srpt->title[i].title_set_nr) + break; + + if (i == ifo_handle->tt_srpt->nr_of_srpts) { + /* not found */ + ifoClose(ifo_handle); + return 0; + } + offset += ifo_handle->tt_srpt->title[i].title_set_sector; + + ifoClose(ifo_handle); + + if (!strcmp(extension, "VOB")) { + ifo_handle = ifoOpen(device, title); + if (0 == ifo_handle) + return 0; + + switch(part) { + case 0: + if (0 == ifo_handle->vtsi_mat->vtsm_vobs) + return 0; + offset += ifo_handle->vtsi_mat->vtsm_vobs; + break; + case 1: + if (0 == ifo_handle->vtsi_mat->vtstt_vobs) + return 0; + offset += ifo_handle->vtsi_mat->vtstt_vobs; + break; + default: /* can't get other parts (also no need to) */ + offset = 0; + break; + } + + ifoClose(ifo_handle); + } + + } + + *filesize = 1000000; /* File size unknown */ + if (offset != 0) + return offset; + } + /* libdvdread_udf.patch end */ + uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ]; uint8_t *LogBlock = (uint8_t *)(((uintptr_t)LogBlock_base & ~((uintptr_t)2047)) + 2048); uint32_t lbnum;