annotate libmpdvdkit2/libdvdread_changes.diff @ 15593:a7abe85e8b41

avoid lrintf redeclaration
author henry
date Mon, 30 May 2005 08:18:03 +0000
parents 5b5ca5c4f381
children 50960b929dd0
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
1 --- dvdread/bswap.h 2002-04-07 19:52:00.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
2 +++ bswap.h 2005-03-01 07:07:45.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
3 @@ -20,8 +20,6 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
4 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
5 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
6
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
7 -#include <config.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
8 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
9 #if defined(WORDS_BIGENDIAN)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
10 /* All bigendian systems are fine, just ignore the swaps. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
11 #define B2N_16(x) (void)(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
12 @@ -48,13 +46,51 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
13 #define B2N_32(x) x = swap32(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
14 #define B2N_64(x) x = swap64(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
15
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
16 +#elif defined(ARCH_X86)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
17 +inline static unsigned short bswap_16(unsigned short x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
18 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
19 + __asm("xchgb %b0,%h0" :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
20 + "=q" (x) :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
21 + "0" (x));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
22 + return x;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
23 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
24 +#define B2N_16(x) x = bswap_16(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
25 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
26 +inline static unsigned int bswap_32(unsigned int x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
27 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
28 + __asm(
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
29 +#if __CPU__ > 386
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
30 + "bswap %0":
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
31 + "=r" (x) :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
32 +#else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
33 + "xchgb %b0,%h0\n"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
34 + " rorl $16,%0\n"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
35 + " xchgb %b0,%h0":
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
36 + "=q" (x) :
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
37 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
38 + "0" (x));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
39 + return x;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
40 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
41 +#define B2N_32(x) x = bswap_32(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
42 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
43 +inline static unsigned long long int bswap_64(unsigned long long int x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
44 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
45 + register union { __extension__ uint64_t __ll;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
46 + uint32_t __l[2]; } __x;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
47 + asm("xchgl %0,%1":
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
48 + "=r"(__x.__l[0]),"=r"(__x.__l[1]):
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
49 + "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32))));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
50 + return __x.__ll;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
51 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
52 +#define B2N_64(x) x = bswap_64(x)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
53 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
54 /* This is a slow but portable implementation, it has multiple evaluation
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
55 * problems so beware.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
56 * FreeBSD and Solaris don't have <byteswap.h> or any other such
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
57 * functionality!
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
58 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
59
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
60 -#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
61 +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(__CYGWIN__)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
62 #define B2N_16(x) \
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
63 x = ((((x) & 0xff00) >> 8) | \
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
64 (((x) & 0x00ff) << 8))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
65 --- dvdread/dvd_input.c 2002-05-09 23:32:46.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
66 +++ dvd_input.c 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
67 @@ -21,13 +21,11 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
68 #include <stdlib.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
69 #include <fcntl.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
70 #include <unistd.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
71 -#include <dlfcn.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
72
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
73 #include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
74 #include "dvd_input.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
75
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
76 -/* For libdvdcss */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
77 -typedef struct dvdcss_s *dvdcss_handle;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
78 +#include "dvdcss.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
79
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
80 dvdcss_handle (*DVDcss_open) (const char *);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
81 int (*DVDcss_close) (dvdcss_handle);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
82 @@ -36,6 +34,12 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
83 int (*DVDcss_read) (dvdcss_handle, void *, int, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
84 char * (*DVDcss_error) (dvdcss_handle);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
85
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
86 +dvd_input_t (*DVDinput_open) (const char *);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
87 +int (*DVDinput_close) (dvd_input_t);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
88 +int (*DVDinput_seek) (dvd_input_t, int, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
89 +int (*DVDinput_title) (dvd_input_t, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
90 +int (*DVDinput_read) (dvd_input_t, void *, int, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
91 +char * (*DVDinput_error) (dvd_input_t);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
92
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
93 /* The DVDinput handle, add stuff here for new input methods. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
94 struct dvd_input_s {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
95 @@ -55,7 +59,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
96 dvd_input_t dev;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
97
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
98 /* Allocate the handle structure */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
99 - dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
100 + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
101 if(dev == NULL) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
102 fprintf(stderr, "libdvdread: Could not allocate memory.\n");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
103 return NULL;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
104 @@ -123,176 +127,26 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
105
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
106
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
107
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
108 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
109 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
110 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
111 -/**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
112 - * initialize and open a DVD device or file.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
113 - */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
114 -static dvd_input_t file_open(const char *target)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
115 -{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
116 - dvd_input_t dev;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
117 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
118 - /* Allocate the library structure */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
119 - dev = (dvd_input_t) malloc(sizeof(dvd_input_t));
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
120 - if(dev == NULL) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
121 - fprintf(stderr, "libdvdread: Could not allocate memory.\n");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
122 - return NULL;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
123 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
124 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
125 - /* Open the device */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
126 - dev->fd = open(target, O_RDONLY);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
127 - if(dev->fd < 0) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
128 - perror("libdvdread: Could not open input");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
129 - free(dev);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
130 - return NULL;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
131 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
132 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
133 - return dev;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
134 -}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
135 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
136 -/**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
137 - * return the last error message
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
138 - */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
139 -static char *file_error(dvd_input_t dev)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
140 -{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
141 - /* use strerror(errno)? */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
142 - return "unknown error";
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
143 -}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
144 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
145 -/**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
146 - * seek into the device.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
147 - */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
148 -static int file_seek(dvd_input_t dev, int blocks, int flags)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
149 -{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
150 - off_t pos;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
151 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
152 - pos = lseek(dev->fd, (off_t)blocks * (off_t)DVD_VIDEO_LB_LEN, SEEK_SET);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
153 - if(pos < 0) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
154 - return pos;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
155 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
156 - /* assert pos % DVD_VIDEO_LB_LEN == 0 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
157 - return (int) (pos / DVD_VIDEO_LB_LEN);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
158 -}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
159 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
160 -/**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
161 - * set the block for the begining of a new title (key).
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
162 - */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
163 -static int file_title(dvd_input_t dev, int block)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
164 -{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
165 - return -1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
166 -}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
167 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
168 -/**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
169 - * read data from the device.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
170 - */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
171 -static int file_read(dvd_input_t dev, void *buffer, int blocks, int flags)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
172 -{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
173 - size_t len;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
174 - ssize_t ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
175 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
176 - len = (size_t)blocks * DVD_VIDEO_LB_LEN;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
177 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
178 - while(len > 0) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
179 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
180 - ret = read(dev->fd, buffer, len);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
181 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
182 - if(ret < 0) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
183 - /* One of the reads failed, too bad. We won't even bother
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
184 - * returning the reads that went ok, and as in the posix spec
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
185 - * the file postition is left unspecified after a failure. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
186 - return ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
187 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
188 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
189 - if(ret == 0) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
190 - /* Nothing more to read. Return the whole blocks, if any, that we got.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
191 - and adjust the file possition back to the previous block boundary. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
192 - size_t bytes = (size_t)blocks * DVD_VIDEO_LB_LEN - len;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
193 - off_t over_read = -(bytes % DVD_VIDEO_LB_LEN);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
194 - /*off_t pos =*/ lseek(dev->fd, over_read, SEEK_CUR);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
195 - /* should have pos % 2048 == 0 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
196 - return (int) (bytes / DVD_VIDEO_LB_LEN);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
197 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
198 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
199 - len -= ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
200 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
201 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
202 - return blocks;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
203 -}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
204 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
205 -/**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
206 - * close the DVD device and clean up.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
207 - */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
208 -static int file_close(dvd_input_t dev)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
209 -{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
210 - int ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
211 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
212 - ret = close(dev->fd);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
213 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
214 - if(ret < 0)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
215 - return ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
216 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
217 - free(dev);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
218 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
219 - return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
220 -}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
221 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
222 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
223 /**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
224 * Setup read functions with either libdvdcss or minimal DVD access.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
225 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
226 int DVDInputSetup(void)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
227 {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
228 - void *dvdcss_library = NULL;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
229 - char **dvdcss_version = NULL;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
230 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
231 - dvdcss_library = dlopen("libdvdcss.so.2", RTLD_LAZY);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
232 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
233 - if(dvdcss_library != NULL) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
234 -#if defined(__OpenBSD__) && !defined(__ELF__)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
235 -#define U_S "_"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
236 -#else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
237 -#define U_S
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
238 -#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
239 - DVDcss_open = (dvdcss_handle (*)(const char*))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
240 - dlsym(dvdcss_library, U_S "dvdcss_open");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
241 - DVDcss_close = (int (*)(dvdcss_handle))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
242 - dlsym(dvdcss_library, U_S "dvdcss_close");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
243 - DVDcss_title = (int (*)(dvdcss_handle, int))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
244 - dlsym(dvdcss_library, U_S "dvdcss_title");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
245 - DVDcss_seek = (int (*)(dvdcss_handle, int, int))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
246 - dlsym(dvdcss_library, U_S "dvdcss_seek");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
247 - DVDcss_read = (int (*)(dvdcss_handle, void*, int, int))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
248 - dlsym(dvdcss_library, U_S "dvdcss_read");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
249 - DVDcss_error = (char* (*)(dvdcss_handle))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
250 - dlsym(dvdcss_library, U_S "dvdcss_error");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
251 + DVDcss_open = dvdcss_open;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
252 + DVDcss_close = dvdcss_close;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
253 + DVDcss_title = dvdcss_title;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
254 + DVDcss_seek = dvdcss_seek;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
255 + DVDcss_read = dvdcss_read;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
256 + DVDcss_error = dvdcss_error;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
257
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
258 - dvdcss_version = (char **)dlsym(dvdcss_library, U_S "dvdcss_interface_2");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
259 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
260 - if(dlsym(dvdcss_library, U_S "dvdcss_crack")) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
261 - fprintf(stderr,
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
262 - "libdvdread: Old (pre-0.0.2) version of libdvdcss found.\n"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
263 - "libdvdread: You should get the latest version from "
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
264 - "http://www.videolan.org/\n" );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
265 - dlclose(dvdcss_library);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
266 - dvdcss_library = NULL;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
267 - } else if(!DVDcss_open || !DVDcss_close || !DVDcss_title || !DVDcss_seek
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
268 - || !DVDcss_read || !DVDcss_error || !dvdcss_version) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
269 - fprintf(stderr, "libdvdread: Missing symbols in libdvdcss.so.2, "
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
270 - "this shouldn't happen !\n");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
271 - dlclose(dvdcss_library);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
272 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
273 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
274 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
275 - if(dvdcss_library != NULL) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
276 /*
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
277 char *psz_method = getenv( "DVDCSS_METHOD" );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
278 char *psz_verbose = getenv( "DVDCSS_VERBOSE" );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
279 fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
280 fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
281 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
282 - fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
283 - *dvdcss_version);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
284 +// fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n",
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
285 +// *dvdcss_version);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
286
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
287 /* libdvdcss wraper functions */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
288 DVDinput_open = css_open;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
289 @@ -303,16 +157,4 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
290 DVDinput_error = css_error;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
291 return 1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
292
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
293 - } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
294 - fprintf(stderr, "libdvdread: Encrypted DVD support unavailable.\n");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
295 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
296 - /* libdvdcss replacement functions */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
297 - DVDinput_open = file_open;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
298 - DVDinput_close = file_close;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
299 - DVDinput_seek = file_seek;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
300 - DVDinput_title = file_title;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
301 - DVDinput_read = file_read;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
302 - DVDinput_error = file_error;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
303 - return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
304 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
305 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
306 --- dvdread/dvd_input.h 2002-05-09 23:21:20.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
307 +++ dvd_input.h 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
308 @@ -36,12 +36,12 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
309 /**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
310 * Pointers which will be filled either the input meathods functions.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
311 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
312 -dvd_input_t (*DVDinput_open) (const char *);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
313 -int (*DVDinput_close) (dvd_input_t);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
314 -int (*DVDinput_seek) (dvd_input_t, int, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
315 -int (*DVDinput_title) (dvd_input_t, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
316 -int (*DVDinput_read) (dvd_input_t, void *, int, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
317 -char * (*DVDinput_error) (dvd_input_t);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
318 +extern dvd_input_t (*DVDinput_open) (const char *);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
319 +extern int (*DVDinput_close) (dvd_input_t);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
320 +extern int (*DVDinput_seek) (dvd_input_t, int, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
321 +extern int (*DVDinput_title) (dvd_input_t, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
322 +extern int (*DVDinput_read) (dvd_input_t, void *, int, int);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
323 +extern char * (*DVDinput_error) (dvd_input_t);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
324
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
325 /**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
326 * Setup function accessed by dvd_reader.c. Returns 1 if there is CSS support.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
327 --- dvdread/dvd_reader.c 2002-05-19 17:48:41.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
328 +++ dvd_reader.c 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
329 @@ -17,6 +17,8 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
330 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
331 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
332
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
333 +#include "config.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
334 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
335 #include <sys/types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
336 #include <sys/stat.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
337 #include <sys/time.h> /* For the timing of dvdcss_title crack. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
338 @@ -35,12 +37,24 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
339
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
340 #if defined(__sun)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
341 #include <sys/mnttab.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
342 +#elif defined(hpux)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
343 +#include </usr/conf/h/mnttab.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
344 #elif defined(SYS_BSD)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
345 #include <fstab.h>
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
346 -#elif defined(__linux__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
347 +#elif defined(__linux__) || defined(__CYGWIN__)
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
348 #include <mntent.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
349 #endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
350
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
351 +#ifdef __MINGW32__
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
352 +#include <sys/timeb.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
353 +static void gettimeofday(struct timeval* t,void* timezone){
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
354 + struct timeb timebuffer;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
355 + ftime( &timebuffer );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
356 + t->tv_sec=timebuffer.time;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
357 + t->tv_usec=1000*timebuffer.millitm;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
358 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
359 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
360 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
361 #include "dvd_udf.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
362 #include "dvd_input.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
363 #include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
364 @@ -144,6 +158,13 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
365 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
366
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
367
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
368 +#ifndef HAVE_MPLAYER
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
369 + #include "get_path.c"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
370 +#else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
371 + extern char * get_path( char * filename );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
372 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
373 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
374 +//extern char * dvdcss_cache_dir;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
375
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
376 /**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
377 * Open a DVD image or block device file.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
378 @@ -152,7 +173,17 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
379 {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
380 dvd_reader_t *dvd;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
381 dvd_input_t dev;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
382 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
383 + /* setup cache dir is no longer needed, it's now implemented in libdvdcss.c
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
384 + if(!dvdcss_cache_dir){
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
385 + dvdcss_cache_dir=get_path( "" );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
386 + if ( dvdcss_cache_dir ) { mkdir( dvdcss_cache_dir,493 ); free( dvdcss_cache_dir ); }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
387 + dvdcss_cache_dir=get_path( "DVDKeys" );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
388 + if(dvdcss_cache_dir) mkdir( dvdcss_cache_dir,493 );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
389 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
390 + */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
391
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
392 + /* open it */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
393 dev = DVDinput_open( location );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
394 if( !dev ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
395 fprintf( stderr, "libdvdread: Can't open %s for reading\n", location );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
396 @@ -222,7 +253,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
397 char *new_path;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
398
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
399 /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
400 - if( !strncmp( path, "/dev/", 5 ) || strncmp( path, "/dev/r", 6 ) )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
401 + if( strncmp( path, "/dev/", 5 ) || !strncmp( path, "/dev/r", 6 ) )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
402 return (char *) strdup( path );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
403
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
404 /* Replace "/dev/" with "/dev/r" */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
405 @@ -242,6 +273,16 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
406
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
407 if( !path ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
408
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
409 +#ifdef WIN32
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
410 + /* Stat doesn't work on devices under mingwin/cygwin. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
411 + if( path[0] && path[1] == ':' && path[2] == '\0' )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
412 + {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
413 + /* Don't try to stat the file */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
414 + fileinfo.st_mode = S_IFBLK;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
415 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
416 + else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
417 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
418 + {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
419 ret = stat( path, &fileinfo );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
420 if( ret < 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
421 /* If we can't stat the file, give up */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
422 @@ -249,6 +290,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
423 perror("");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
424 return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
425 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
426 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
427
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
428 /* Try to open libdvdcss or fall back to standard functions */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
429 have_css = DVDInputSetup();
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
430 @@ -274,7 +320,7 @@
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
431 char *path_copy;
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
432 #if defined(SYS_BSD)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
433 struct fstab* fe;
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
434 -#elif defined(__sun) || defined(__linux__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
435 +#elif defined(__sun) || defined(__linux__) || defined(__CYGWIN__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
436 FILE *mntfile;
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
437 #endif
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
438
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
439 @@ -289,7 +331,9 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
440 if( cdir >= 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
441 chdir( path_copy );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
442 new_path = getcwd( NULL, PATH_MAX );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
443 +#ifndef __MINGW32__
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
444 fchdir( cdir );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
445 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
446 close( cdir );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
447 if( new_path ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
448 free( path_copy );
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
449 @@ -345,7 +393,7 @@
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
450 }
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
451 fclose( mntfile );
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
452 }
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
453 -#elif defined(__linux__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
454 +#elif defined(__linux__) || defined(__CYGWIN__)
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
455 mntfile = fopen( MOUNTED, "r" );
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
456 if( mntfile ) {
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
457 struct mntent *me;
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
458 @@ -364,6 +408,9 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
459 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
460 fclose( mntfile );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
461 }
15535
5b5ca5c4f381 Update for latest Cygwin-related changes.
diego
parents: 14937
diff changeset
462 +#elif defined(__MINGW32__)
14937
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
463 + dev_name = strdup(path);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
464 + auth_drive = DVDOpenImageFile( path, have_css );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
465 #endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
466 if( !dev_name ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
467 fprintf( stderr, "libdvdread: Couldn't find device name.\n" );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
468 @@ -554,8 +601,8 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
469 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
470
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
471 if( dvd->css_state == 1 /* Need key init */ ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
472 - initAllCSSKeys( dvd );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
473 - dvd->css_state = 2;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
474 +// initAllCSSKeys( dvd );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
475 +// dvd->css_state = 2;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
476 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
477 /*
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
478 if( DVDinput_seek( dvd_file->dvd->dev,
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
479 @@ -631,10 +678,9 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
480 dvd_file->title_sizes[ i ] = fileinfo.st_size / DVD_VIDEO_LB_LEN;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
481 dvd_file->title_devs[ i ] = DVDinput_open( full_path );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
482 dvd_file->filesize += dvd_file->title_sizes[ i ];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
483 + DVDinput_seek( dvd_file->title_devs[ i ], 0, DVDINPUT_SEEK_KEY );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
484 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
485 - if( dvd_file->title_devs[ 0 ] ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
486 - DVDinput_seek( dvd_file->title_devs[ 0 ], 0, DVDINPUT_SEEK_KEY );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
487 - } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
488 + if( !dvd_file->title_devs[ 0 ] ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
489 free( dvd_file );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
490 return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
491 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
492 @@ -794,7 +840,10 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
493 if( ret < 0 ) return ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
494 /* FIXME: This is wrong if i is the last file in the set.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
495 * also error from this read will not show in ret. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
496 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
497 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
498 + /* Does the next part exist? If not then return now. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
499 + if( !dvd_file->title_devs[ i + 1 ] ) return ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
500 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
501 /* Read part 2 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
502 off = DVDinput_seek( dvd_file->title_devs[ i + 1 ],
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
503 0, DVDINPUT_NOFLAGS );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
504 @@ -846,7 +895,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
505 return (ssize_t)ret;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
506 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
507
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
508 -int32_t DVDFileSeek( dvd_file_t *dvd_file, int32_t offset )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
509 +int DVDFileSeek( dvd_file_t *dvd_file, int offset )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
510 {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
511 if( offset > dvd_file->filesize * DVD_VIDEO_LB_LEN ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
512 return -1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
513 --- dvdread/dvd_udf.c 2002-05-06 22:16:31.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
514 +++ dvd_udf.c 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
515 @@ -4,6 +4,9 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
516 *
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
517 * Modifications by:
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
518 * Billy Biggs <vektor@dumbterm.net>.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
519 + * Björn Englund <d4bjorn@dtek.chalmers.se>.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
520 + * Joey Parrish <joey@nicewarrior.org>.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
521 + * - updated from libdvdread 0.9.4 and removed udf caching
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
522 *
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
523 * dvdudf: parse and read the UDF volume information of a DVD Video
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
524 * Copyright (C) 1999 Christian Wolff for convergence integrated media
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
525 @@ -30,8 +33,10 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
526 #include <stdio.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
527 #include <stdlib.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
528 #include <string.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
529 -#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
530 +//#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
531 +#ifndef __MINGW32__
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
532 #include <sys/ioctl.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
533 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
534 #include <sys/types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
535 #include <sys/stat.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
536 #include <unistd.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
537 @@ -93,6 +98,32 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
538 uint16_t Partition;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
539 };
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
540
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
541 +struct extent_ad {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
542 + uint32_t location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
543 + uint32_t length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
544 +};
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
545 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
546 +struct avdp_t {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
547 + struct extent_ad mvds;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
548 + struct extent_ad rvds;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
549 +};
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
550 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
551 +struct pvd_t {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
552 + uint8_t VolumeIdentifier[32];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
553 + uint8_t VolumeSetIdentifier[128];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
554 +};
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
555 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
556 +struct lbudf {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
557 + uint32_t lb;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
558 + uint8_t *data;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
559 +};
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
560 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
561 +struct icbmap {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
562 + uint32_t lbn;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
563 + struct AD file;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
564 + uint8_t filetype;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
565 +};
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
566 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
567 /* For direct data access, LSB first */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
568 #define GETN1(p) ((uint8_t)data[p])
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
569 #define GETN2(p) ((uint16_t)data[p] | ((uint16_t)data[(p) + 1] << 8))
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
570 @@ -334,6 +365,67 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
571 return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
572 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
573
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
574 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
575 +static int UDFGetAVDP( dvd_reader_t *device,
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
576 + struct avdp_t *avdp)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
577 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
578 + uint8_t Anchor[ DVD_VIDEO_LB_LEN ];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
579 + uint32_t lbnum, MVDS_location, MVDS_length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
580 + uint16_t TagID;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
581 + uint32_t lastsector;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
582 + int terminate;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
583 + struct avdp_t;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
584 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
585 + /* Find Anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
586 + lastsector = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
587 + lbnum = 256; /* Try #1, prime anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
588 + terminate = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
589 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
590 + for(;;) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
591 + if( DVDReadLBUDF( device, lbnum, 1, Anchor, 0 ) > 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
592 + UDFDescriptor( Anchor, &TagID );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
593 + } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
594 + TagID = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
595 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
596 + if (TagID != 2) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
597 + /* Not an anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
598 + if( terminate ) return 0; /* Final try failed */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
599 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
600 + if( lastsector ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
601 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
602 + /* We already found the last sector. Try #3, alternative
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
603 + * backup anchor. If that fails, don't try again.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
604 + */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
605 + lbnum = lastsector;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
606 + terminate = 1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
607 + } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
608 + /* TODO: Find last sector of the disc (this is optional). */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
609 + if( lastsector ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
610 + /* Try #2, backup anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
611 + lbnum = lastsector - 256;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
612 + } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
613 + /* Unable to find last sector */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
614 + return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
615 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
616 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
617 + } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
618 + /* It's an anchor! We can leave */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
619 + break;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
620 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
621 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
622 + /* Main volume descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
623 + UDFExtentAD( &Anchor[ 16 ], &MVDS_length, &MVDS_location );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
624 + avdp->mvds.location = MVDS_location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
625 + avdp->mvds.length = MVDS_length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
626 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
627 + /* Backup volume descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
628 + UDFExtentAD( &Anchor[ 24 ], &MVDS_length, &MVDS_location );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
629 + avdp->rvds.location = MVDS_location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
630 + avdp->rvds.length = MVDS_length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
631 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
632 + return 1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
633 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
634 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
635 /**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
636 * Looks for partition on the disc. Returns 1 if partition found, 0 on error.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
637 * partnum: Number of the partition, starting at 0.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
638 @@ -342,52 +434,21 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
639 static int UDFFindPartition( dvd_reader_t *device, int partnum,
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
640 struct Partition *part )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
641 {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
642 - uint8_t LogBlock[ DVD_VIDEO_LB_LEN ], Anchor[ DVD_VIDEO_LB_LEN ];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
643 + uint8_t LogBlock[ DVD_VIDEO_LB_LEN ];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
644 uint32_t lbnum, MVDS_location, MVDS_length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
645 uint16_t TagID;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
646 - uint32_t lastsector;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
647 - int i, terminate, volvalid;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
648 + int i, volvalid;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
649 + struct avdp_t avdp;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
650
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
651 - /* Find Anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
652 - lastsector = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
653 - lbnum = 256; /* Try #1, prime anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
654 - terminate = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
655 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
656 - for(;;) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
657 - if( DVDReadLBUDF( device, lbnum, 1, Anchor, 0 ) > 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
658 - UDFDescriptor( Anchor, &TagID );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
659 - } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
660 - TagID = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
661 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
662 - if (TagID != 2) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
663 - /* Not an anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
664 - if( terminate ) return 0; /* Final try failed */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
665 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
666 - if( lastsector ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
667 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
668 - /* We already found the last sector. Try #3, alternative
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
669 - * backup anchor. If that fails, don't try again.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
670 - */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
671 - lbnum = lastsector;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
672 - terminate = 1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
673 - } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
674 - /* TODO: Find last sector of the disc (this is optional). */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
675 - if( lastsector ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
676 - /* Try #2, backup anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
677 - lbnum = lastsector - 256;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
678 - } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
679 - /* Unable to find last sector */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
680 - return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
681 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
682 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
683 - } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
684 - /* It's an anchor! We can leave */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
685 - break;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
686 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
687 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
688 + if(!UDFGetAVDP(device, &avdp)) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
689 + return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
690 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
691 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
692 /* Main volume descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
693 - UDFExtentAD( &Anchor[ 16 ], &MVDS_length, &MVDS_location );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
694 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
695 + MVDS_location = avdp.mvds.location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
696 + MVDS_length = avdp.mvds.length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
697 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
698 part->valid = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
699 volvalid = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
700 part->VolumeDesc[ 0 ] = '\0';
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
701 @@ -422,8 +483,9 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
702 && ( ( !part->valid ) || ( !volvalid ) ) );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
703
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
704 if( ( !part->valid) || ( !volvalid ) ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
705 - /* Backup volume descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
706 - UDFExtentAD( &Anchor[ 24 ], &MVDS_length, &MVDS_location );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
707 + /* Backup volume descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
708 + MVDS_location = avdp.mvds.location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
709 + MVDS_length = avdp.mvds.length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
710 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
711 } while( i-- && ( ( !part->valid ) || ( !volvalid ) ) );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
712
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
713 @@ -442,17 +504,18 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
714 char tokenline[ MAX_UDF_FILE_NAME_LEN ];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
715 char *token;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
716 uint8_t filetype;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
717 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
718 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
719 *filesize = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
720 tokenline[0] = '\0';
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
721 strcat( tokenline, filename );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
722
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
723 - /* Find partition, 0 is the standard location for DVD Video.*/
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
724 - if( !UDFFindPartition( device, 0, &partition ) ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
725 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
726 - /* Find root dir ICB */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
727 - lbnum = partition.Start;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
728 - do {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
729 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
730 + /* Find partition, 0 is the standard location for DVD Video.*/
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
731 + if( !UDFFindPartition( device, 0, &partition ) ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
732 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
733 + /* Find root dir ICB */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
734 + lbnum = partition.Start;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
735 + do {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
736 if( DVDReadLBUDF( device, lbnum++, 1, LogBlock, 0 ) <= 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
737 TagID = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
738 } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
739 @@ -469,19 +532,27 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
740 /* Sanity checks. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
741 if( TagID != 256 ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
742 if( RootICB.Partition != 0 ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
743 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
744 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
745 /* Find root dir */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
746 if( !UDFMapICB( device, RootICB, &filetype, &partition, &File ) ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
747 if( filetype != 4 ) return 0; /* Root dir should be dir */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
748
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
749 - /* Tokenize filepath */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
750 - token = strtok(tokenline, "/");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
751 - while( token != NULL ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
752 - if( !UDFScanDir( device, File, token, &partition, &ICB ) ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
753 - if( !UDFMapICB( device, ICB, &filetype, &partition, &File ) ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
754 + {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
755 + /* Tokenize filepath */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
756 + token = strtok(tokenline, "/");
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
757 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
758 + while( token != NULL ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
759 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
760 + if( !UDFScanDir( device, File, token, &partition, &ICB)) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
761 + return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
762 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
763 + if( !UDFMapICB( device, ICB, &filetype, &partition, &File ) ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
764 + return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
765 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
766 token = strtok( NULL, "/" );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
767 - }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
768 -
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
769 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
770 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
771 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
772 /* Sanity check. */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
773 if( File.Partition != 0 ) return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
774
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
775 @@ -492,3 +563,81 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
776 else
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
777 return partition.Start + File.Location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
778 }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
779 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
780 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
781 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
782 +/**
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
783 + * Gets a Descriptor .
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
784 + * Returns 1 if descriptor found, 0 on error.
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
785 + * id, tagid of descriptor
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
786 + * bufsize, size of BlockBuf (must be >= DVD_VIDEO_LB_LEN).
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
787 + */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
788 +static int UDFGetDescriptor( dvd_reader_t *device, int id,
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
789 + uint8_t *descriptor, int bufsize)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
790 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
791 + uint32_t lbnum, MVDS_location, MVDS_length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
792 + struct avdp_t avdp;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
793 + uint16_t TagID;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
794 + uint32_t lastsector;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
795 + int i, terminate;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
796 + int desc_found = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
797 + /* Find Anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
798 + lastsector = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
799 + lbnum = 256; /* Try #1, prime anchor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
800 + terminate = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
801 + if(bufsize < DVD_VIDEO_LB_LEN) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
802 + return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
803 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
804 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
805 + if(!UDFGetAVDP(device, &avdp)) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
806 + return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
807 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
808 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
809 + /* Main volume descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
810 + MVDS_location = avdp.mvds.location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
811 + MVDS_length = avdp.mvds.length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
812 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
813 + i = 1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
814 + do {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
815 + /* Find Descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
816 + lbnum = MVDS_location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
817 + do {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
818 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
819 + if( DVDReadLBUDF( device, lbnum++, 1, descriptor, 0 ) <= 0 ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
820 + TagID = 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
821 + } else {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
822 + UDFDescriptor( descriptor, &TagID );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
823 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
824 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
825 + if( (TagID == id) && ( !desc_found ) ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
826 + /* Descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
827 + desc_found = 1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
828 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
829 + } while( ( lbnum <= MVDS_location + ( MVDS_length - 1 )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
830 + / DVD_VIDEO_LB_LEN ) && ( TagID != 8 )
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
831 + && ( !desc_found) );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
832 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
833 + if( !desc_found ) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
834 + /* Backup volume descriptor */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
835 + MVDS_location = avdp.rvds.location;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
836 + MVDS_length = avdp.rvds.length;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
837 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
838 + } while( i-- && ( !desc_found ) );
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
839 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
840 + return desc_found;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
841 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
842 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
843 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
844 +static int UDFGetPVD(dvd_reader_t *device, struct pvd_t *pvd)
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
845 +{
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
846 + uint8_t pvd_buf[DVD_VIDEO_LB_LEN];
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
847 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
848 + if(!UDFGetDescriptor( device, 1, pvd_buf, sizeof(pvd_buf))) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
849 + return 0;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
850 + }
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
851 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
852 + memcpy(pvd->VolumeIdentifier, &pvd_buf[24], 32);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
853 + memcpy(pvd->VolumeSetIdentifier, &pvd_buf[72], 128);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
854 +
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
855 + return 1;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
856 +}
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
857 --- dvdread/ifo_print.c 2002-05-15 21:35:54.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
858 +++ ifo_print.c 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
859 @@ -23,7 +23,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
860 #include <inttypes.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
861 #include <string.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
862 #include <ctype.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
863 -#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
864 +//#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
865
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
866 #include "config.h" // Needed for WORDS_BIGENDIAN
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
867 #include "ifo_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
868 --- dvdread/ifo_print.h 2002-04-07 19:52:01.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
869 +++ ifo_print.h 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
870 @@ -20,8 +20,8 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
871 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
872 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
873
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
874 -#include <dvdread/ifo_types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
875 -#include <dvdread/dvd_reader.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
876 +#include "ifo_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
877 +#include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
878
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
879 #ifdef __cplusplus
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
880 extern "C" {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
881 --- dvdread/ifo_read.c 2002-05-25 21:37:18.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
882 +++ ifo_read.c 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
883 @@ -22,7 +22,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
884 #include <unistd.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
885 #include <inttypes.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
886 #include <string.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
887 -#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
888 +//#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
889
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
890 #include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
891
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
892 --- dvdread/ifo_read.h 2002-04-07 19:52:01.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
893 +++ ifo_read.h 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
894 @@ -20,8 +20,8 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
895 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
896 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
897
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
898 -#include <dvdread/ifo_types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
899 -#include <dvdread/dvd_reader.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
900 +#include "ifo_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
901 +#include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
902
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
903 #ifdef __cplusplus
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
904 extern "C" {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
905 --- dvdread/ifo_types.h 2002-04-07 19:52:01.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
906 +++ ifo_types.h 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
907 @@ -21,7 +21,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
908 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
909
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
910 #include <inttypes.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
911 -#include <dvdread/dvd_reader.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
912 +#include "dvd_reader.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
913
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
914
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
915 #undef ATTRIBUTE_PACKED
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
916 --- dvdread/nav_print.c 2002-04-07 19:18:06.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
917 +++ nav_print.c 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
918 @@ -25,7 +25,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
919
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
920 #include <stdio.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
921 #include <inttypes.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
922 -#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
923 +//#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
924
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
925 #include "config.h" // Needed for WORDS_BIGENDIAN
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
926 #include "nav_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
927 --- dvdread/nav_print.h 2002-04-07 20:17:19.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
928 +++ nav_print.h 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
929 @@ -20,7 +20,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
930 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
931 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
932
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
933 -#include <dvdread/nav_types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
934 +#include "nav_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
935
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
936 #ifdef __cplusplus
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
937 extern "C" {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
938 --- dvdread/nav_read.c 2002-04-07 19:52:01.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
939 +++ nav_read.c 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
940 @@ -19,7 +19,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
941 #include <stdio.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
942 #include <string.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
943 #include <inttypes.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
944 -#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
945 +//#include <assert.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
946
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
947 #include "config.h" // Needed for WORDS_BIGENDIAN
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
948 #include "bswap.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
949 @@ -95,7 +95,9 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
950 /* pci hli btnit */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
951 for(i = 0; i < pci->hli.hl_gi.btngr_ns; i++) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
952 for(j = 0; j < (36 / pci->hli.hl_gi.btngr_ns); j++) {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
953 +#ifdef HAVE_ASSERT_H
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
954 int n = (36 / pci->hli.hl_gi.btngr_ns) * i + j;
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
955 +#endif
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
956 assert(pci->hli.btnit[n].zero1 == 0);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
957 assert(pci->hli.btnit[n].zero2 == 0);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
958 assert(pci->hli.btnit[n].zero3 == 0);
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
959 --- dvdread/nav_read.h 2002-04-07 20:17:19.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
960 +++ nav_read.h 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
961 @@ -19,7 +19,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
962 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
963 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
964
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
965 -#include <dvdread/nav_types.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
966 +#include "nav_types.h"
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
967
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
968 #ifdef __cplusplus
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
969 extern "C" {
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
970 --- dvdread/nav_types.h 2002-04-07 20:41:59.000000000 +0200
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
971 +++ nav_types.h 2005-03-01 07:07:46.000000000 +0100
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
972 @@ -30,7 +30,7 @@
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
973 */
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
974
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
975 #include <inttypes.h>
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
976 -#include <dvdread/ifo_types.h> // only dvd_time_t, vm_cmd_t and user_ops_t
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
977 +#include "ifo_types.h" // only dvd_time_t, vm_cmd_t and user_ops_t
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
978
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
979
d18e40806248 MPlayer-specific changes to libdvdread
diego
parents:
diff changeset
980 #undef ATTRIBUTE_PACKED