1 diff -Nur libdvdread-4.1.3_p1168-orig/src/dvd_input.c libdvdread-4.1.3_p1168/src/dvd_input.c
2 --- libdvdread-4.1.3_p1168-orig/src/dvd_input.c 2009-03-09 18:41:50.000000000 +0100
3 +++ libdvdread-4.1.3_p1168/src/dvd_input.c 2010-08-16 01:52:24.000000000 +0200
6 #endif /* HAVE_DVDCSS_DVDCSS_H */
8 + fprintf(stderr, "libdvdread patched to play DVDs with DVD-Movie-Protect\n");
10 if(dvdcss_library != NULL) {
12 char *psz_method = getenv( "DVDCSS_METHOD" );
13 diff -Nur libdvdread-4.1.3_p1168-orig/src/dvd_udf.c libdvdread-4.1.3_p1168/src/dvd_udf.c
14 --- libdvdread-4.1.3_p1168-orig/src/dvd_udf.c 2009-03-09 18:41:50.000000000 +0100
15 +++ libdvdread-4.1.3_p1168/src/dvd_udf.c 2010-08-16 01:53:03.000000000 +0200
24 #include "dvdread/dvd_reader.h"
25 #include "dvdread/dvd_udf.h"
27 +#include "dvdread/ifo_types.h"
28 +#include "dvdread/ifo_read.h"
30 /* Private but located in/shared with dvd_reader.c */
31 extern int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
32 size_t block_count, unsigned char *data,
37 -uint32_t UDFFindFile( dvd_reader_t *device, char *filename,
38 +static uint32_t UDFFindFileReal( dvd_reader_t *device, char *filename,
41 uint8_t LogBlock_base[ DVD_VIDEO_LB_LEN + 2048 ];
43 return partition.Start + File.Location;
47 + * Get the offset from the ifo files to allow playback of DVDs
48 + * with a deliberately broken UDF file system (aka DVD-Movie-Protect).
49 + * When the file is not an IFO or VOB, it calls the real UDF routine.
51 +uint32_t UDFFindFile( dvd_reader_t *device, char *filename,
52 + uint32_t *filesize )
55 + if (!fnmatch("/VIDEO_TS/VTS_[0-9][0-9]_[0-9].???", filename, FNM_PATHNAME)) {
57 + if (strlen("/VIDEO_TS/VTS_01_1.VOB") == strlen(filename)
58 + && !strncmp(filename, "/VIDEO_TS/VTS_", strlen("/VIDEO_TS/VTS_")) ) {
60 + size_t len = strlen(filename);
61 + char *extension = &filename[len-3];
62 + if (!strcmp(extension, "IFO") || !strcmp(extension, "VOB")) {
63 + int title = atoi(&filename[len-8]);
64 + int part = atoi(&filename[len-5]);
66 + ifo_handle_t *ifo_handle = ifoOpen(device, 0);
67 + if (0 == ifo_handle)
70 + uint32_t tmp_filesize;
71 + uint32_t offset = UDFFindFileReal(device, "/VIDEO_TS/VIDEO_TS.IFO", &tmp_filesize);
74 + for (i=0; i<ifo_handle->tt_srpt->nr_of_srpts; i++)
75 + if (title == ifo_handle->tt_srpt->title[i].title_set_nr)
78 + if (i == ifo_handle->tt_srpt->nr_of_srpts) {
80 + ifoClose(ifo_handle);
83 + offset += ifo_handle->tt_srpt->title[i].title_set_sector;
84 + ifoClose(ifo_handle);
86 + if (!strcmp(extension, "VOB")) {
87 + ifo_handle = ifoOpen(device, title);
88 + if (0 == ifo_handle)
93 + if (0 == ifo_handle->vtsi_mat->vtsm_vobs) {
94 + ifoClose(ifo_handle);
97 + offset += ifo_handle->vtsi_mat->vtsm_vobs;
100 + if (0 == ifo_handle->vtsi_mat->vtstt_vobs) {
101 + ifoClose(ifo_handle);
104 + offset += ifo_handle->vtsi_mat->vtstt_vobs;
106 + default: /* can't get other parts (also no need to) */
111 + ifoClose(ifo_handle);
115 + *filesize = 1000000; /* File size unknown */
121 + return UDFFindFileReal( device, filename, filesize);