Mercurial > mplayer.hg
annotate libmpdvdkit2/libdvdread_changes.diff @ 16759:4fe8f21fd1da
third time is lucky, eh? last workaround broke netbsd, which apparently also has a broken noncompliant implementation of tr. if it still doesn't work... blame someone else. :)
author | rfelker |
---|---|
date | Fri, 14 Oct 2005 00:16:04 +0000 |
parents | 880739620241 |
children | 72c1c7054ad5 |
rev | line source |
---|---|
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
1 diff -Naur dvdread.orig/bswap.h dvdread/bswap.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
2 --- dvdread.orig/bswap.h 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
3 +++ dvdread/bswap.h 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
4 @@ -20,8 +24,6 @@ |
14937 | 5 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
6 */ | |
7 | |
8 -#include <config.h> | |
9 - | |
10 #if defined(WORDS_BIGENDIAN) | |
11 /* All bigendian systems are fine, just ignore the swaps. */ | |
12 #define B2N_16(x) (void)(x) | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
13 @@ -59,13 +61,57 @@ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
14 #define B2N_32(x) x = be32toh(x) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
15 #define B2N_64(x) x = be64toh(x) |
14937 | 16 |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
17 +#elif defined(__DragonFly__) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
18 +#include <sys/endian.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
19 +#define B2N_16(x) x = be16toh(x) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
20 +#define B2N_32(x) x = be32toh(x) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
21 +#define B2N_64(x) x = be64toh(x) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
22 + |
14937 | 23 +#elif defined(ARCH_X86) |
24 +inline static unsigned short bswap_16(unsigned short x) | |
25 +{ | |
26 + __asm("xchgb %b0,%h0" : | |
27 + "=q" (x) : | |
28 + "0" (x)); | |
29 + return x; | |
30 +} | |
31 +#define B2N_16(x) x = bswap_16(x) | |
32 + | |
33 +inline static unsigned int bswap_32(unsigned int x) | |
34 +{ | |
35 + __asm( | |
36 +#if __CPU__ > 386 | |
37 + "bswap %0": | |
38 + "=r" (x) : | |
39 +#else | |
40 + "xchgb %b0,%h0\n" | |
41 + " rorl $16,%0\n" | |
42 + " xchgb %b0,%h0": | |
43 + "=q" (x) : | |
44 +#endif | |
45 + "0" (x)); | |
46 + return x; | |
47 +} | |
48 +#define B2N_32(x) x = bswap_32(x) | |
49 + | |
50 +inline static unsigned long long int bswap_64(unsigned long long int x) | |
51 +{ | |
52 + register union { __extension__ uint64_t __ll; | |
53 + uint32_t __l[2]; } __x; | |
54 + asm("xchgl %0,%1": | |
55 + "=r"(__x.__l[0]),"=r"(__x.__l[1]): | |
56 + "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32)))); | |
57 + return __x.__ll; | |
58 +} | |
59 +#define B2N_64(x) x = bswap_64(x) | |
60 + | |
61 /* This is a slow but portable implementation, it has multiple evaluation | |
62 * problems so beware. | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
63 * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such |
14937 | 64 * functionality! |
65 */ | |
66 | |
67 -#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) | |
68 +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(__CYGWIN__) | |
69 #define B2N_16(x) \ | |
70 x = ((((x) & 0xff00) >> 8) | \ | |
71 (((x) & 0x00ff) << 8)) | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
72 diff -Naur dvdread.orig/.cvsignore dvdread/.cvsignore |
16726
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
73 diff -Naur dvdread.orig/common.h dvdread/common.h |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
74 --- dvdread.orig/common.h 2005-10-11 10:55:45.000000000 +0200 |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
75 +++ dvdread/common.h 2005-10-11 14:07:42.000000000 +0200 |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
76 @@ -50,10 +50,9 @@ |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
77 # define PATH_MAX MAX_PATH |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
78 #endif |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
79 |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
80 -#define lseek _lseeki64 |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
81 - |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
82 /* several type definitions */ |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
83 # if defined( __MINGW32__ ) |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
84 +#define lseek _lseeki64 |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
85 # if !defined( _OFF_T_ ) |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
86 typedef long long _off_t; |
880739620241
Compile fix: _lseeki64 is not available under cygwin
reimar
parents:
16659
diff
changeset
|
87 typedef _off_t off_t; |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
88 diff -Naur dvdread.orig/dvd_input.c dvdread/dvd_input.c |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
89 --- dvdread.orig/dvd_input.c 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
90 +++ dvdread/dvd_input.c 2005-06-23 00:30:23.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
91 @@ -37,7 +41,7 @@ |
14937 | 92 |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
93 #ifdef HAVE_DVDCSS_DVDCSS_H |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
94 /* linking to libdvdcss */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
95 -#include <dvdcss/dvdcss.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
96 +#include "dvdcss.h" |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
97 #define DVDcss_open(a) dvdcss_open((char*)(a)) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
98 #define DVDcss_close dvdcss_close |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
99 #define DVDcss_seek dvdcss_seek |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
100 @@ -74,7 +78,7 @@ |
14937 | 101 dvd_input_t dev; |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
102 |
14937 | 103 /* Allocate the handle structure */ |
104 - dev = (dvd_input_t) malloc(sizeof(dvd_input_t)); | |
105 + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s)); | |
106 if(dev == NULL) { | |
107 fprintf(stderr, "libdvdread: Could not allocate memory.\n"); | |
108 return NULL; | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
109 @@ -320,8 +324,10 @@ |
14937 | 110 fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method); |
111 fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose); | |
112 */ | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
113 + /* |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
114 fprintf(stderr, "libdvdread: Using libdvdcss version %s for DVD access\n", |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
115 *dvdcss_version); |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
116 + */ |
14937 | 117 |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
118 /* libdvdcss wrapper functions */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
119 dvdinput_open = css_open; |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
120 diff -Naur dvdread.orig/dvd_input.h dvdread/dvd_input.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
121 diff -Naur dvdread.orig/dvd_reader.c dvdread/dvd_reader.c |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
122 --- dvdread.orig/dvd_reader.c 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
123 +++ dvdread/dvd_reader.c 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
124 @@ -32,24 +36,36 @@ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
125 #include <limits.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
126 #include <dirent.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
127 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
128 -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
129 +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__) || defined(__DragonFly__) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
130 #define SYS_BSD 1 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
131 #endif |
14937 | 132 |
133 #if defined(__sun) | |
134 #include <sys/mnttab.h> | |
135 +#elif defined(hpux) | |
136 +#include </usr/conf/h/mnttab.h> | |
137 #elif defined(SYS_BSD) | |
138 #include <fstab.h> | |
15535 | 139 -#elif defined(__linux__) |
140 +#elif defined(__linux__) || defined(__CYGWIN__) | |
14937 | 141 #include <mntent.h> |
142 #endif | |
143 | |
144 +#ifdef __MINGW32__ | |
145 +#include <sys/timeb.h> | |
146 +static void gettimeofday(struct timeval* t,void* timezone){ | |
147 + struct timeb timebuffer; | |
148 + ftime( &timebuffer ); | |
149 + t->tv_sec=timebuffer.time; | |
150 + t->tv_usec=1000*timebuffer.millitm; | |
151 +} | |
152 +#endif | |
153 + | |
154 #include "dvd_udf.h" | |
155 #include "dvd_input.h" | |
156 #include "dvd_reader.h" | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
157 #include "md5.h" |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
158 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
159 -#define DEFAULT_UDF_CACHE_LEVEL 1 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
160 +#define DEFAULT_UDF_CACHE_LEVEL 0 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
161 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
162 struct dvd_reader_s { |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
163 /* Basic information. */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
164 @@ -194,6 +210,13 @@ |
14937 | 165 } |
166 | |
167 | |
168 +#ifndef HAVE_MPLAYER | |
169 + #include "get_path.c" | |
170 +#else | |
171 + extern char * get_path( char * filename ); | |
172 +#endif | |
173 + | |
174 +//extern char * dvdcss_cache_dir; | |
175 | |
176 /** | |
177 * Open a DVD image or block device file. | |
16510 | 178 @@ -278,11 +301,16 @@ |
179 Darwin /dev/rdisk0, it needs to be the raw device | |
180 BSD/OS /dev/sr0c (if not mounted) or /dev/rsr0c ('c' any letter will do) */ | |
181 static char *bsd_block2char( const char *path ) | |
182 +#if defined(__FreeBSD__) | |
183 +{ | |
184 + return (char *) strdup( path ); | |
185 +} | |
186 +#else | |
187 { | |
14937 | 188 char *new_path; |
189 | |
190 /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */ | |
191 - if( !strncmp( path, "/dev/", 5 ) || strncmp( path, "/dev/r", 6 ) ) | |
192 + if( strncmp( path, "/dev/", 5 ) || !strncmp( path, "/dev/r", 6 ) ) | |
193 return (char *) strdup( path ); | |
194 | |
195 /* Replace "/dev/" with "/dev/r" */ | |
16510 | 196 @@ -292,6 +320,7 @@ |
197 | |
198 return new_path; | |
199 } | |
200 +#endif /* __FreeBSD__ */ | |
201 #endif | |
202 | |
203 dvd_reader_t *DVDOpen( const char *path ) | |
204 @@ -303,6 +332,16 @@ | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
205 if( path == NULL ) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
206 return 0; |
14937 | 207 |
208 +#ifdef WIN32 | |
209 + /* Stat doesn't work on devices under mingwin/cygwin. */ | |
210 + if( path[0] && path[1] == ':' && path[2] == '\0' ) | |
211 + { | |
212 + /* Don't try to stat the file */ | |
213 + fileinfo.st_mode = S_IFBLK; | |
214 + } | |
215 + else | |
216 +#endif | |
217 + { | |
218 ret = stat( path, &fileinfo ); | |
219 if( ret < 0 ) { | |
220 /* If we can't stat the file, give up */ | |
16510 | 221 @@ -310,6 +349,7 @@ |
14937 | 222 perror(""); |
223 return 0; | |
224 } | |
225 + } | |
226 | |
227 /* Try to open libdvdcss or fall back to standard functions */ | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
228 have_css = dvdinput_setup(); |
16510 | 229 @@ -335,7 +375,7 @@ |
15535 | 230 char *path_copy; |
231 #if defined(SYS_BSD) | |
232 struct fstab* fe; | |
233 -#elif defined(__sun) || defined(__linux__) | |
234 +#elif defined(__sun) || defined(__linux__) || defined(__CYGWIN__) | |
235 FILE *mntfile; | |
236 #endif | |
237 | |
16510 | 238 @@ -350,7 +390,9 @@ |
14937 | 239 if( cdir >= 0 ) { |
240 chdir( path_copy ); | |
241 new_path = getcwd( NULL, PATH_MAX ); | |
242 +#ifndef __MINGW32__ | |
243 fchdir( cdir ); | |
244 +#endif | |
245 close( cdir ); | |
246 if( new_path ) { | |
247 free( path_copy ); | |
16510 | 248 @@ -406,7 +448,7 @@ |
15535 | 249 } |
250 fclose( mntfile ); | |
251 } | |
252 -#elif defined(__linux__) | |
253 +#elif defined(__linux__) || defined(__CYGWIN__) | |
254 mntfile = fopen( MOUNTED, "r" ); | |
255 if( mntfile ) { | |
256 struct mntent *me; | |
16510 | 257 @@ -425,6 +467,9 @@ |
14937 | 258 } |
259 fclose( mntfile ); | |
260 } | |
15535 | 261 +#elif defined(__MINGW32__) |
14937 | 262 + dev_name = strdup(path); |
263 + auth_drive = DVDOpenImageFile( path, have_css ); | |
264 #endif | |
265 if( !dev_name ) { | |
266 fprintf( stderr, "libdvdread: Couldn't find device name.\n" ); | |
16510 | 267 @@ -615,8 +660,8 @@ |
14937 | 268 } |
269 | |
270 if( dvd->css_state == 1 /* Need key init */ ) { | |
271 - initAllCSSKeys( dvd ); | |
272 - dvd->css_state = 2; | |
273 +// initAllCSSKeys( dvd ); | |
274 +// dvd->css_state = 2; | |
275 } | |
276 /* | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
277 if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) { |
16510 | 278 @@ -915,7 +960,7 @@ |
14937 | 279 return (ssize_t)ret; |
280 } | |
281 | |
282 -int32_t DVDFileSeek( dvd_file_t *dvd_file, int32_t offset ) | |
283 +int DVDFileSeek( dvd_file_t *dvd_file, int offset ) | |
284 { | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
285 /* Check arguments. */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
286 if( dvd_file == NULL || offset < 0 ) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
287 diff -Naur dvdread.orig/dvdread_internal.h dvdread/dvdread_internal.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
288 --- dvdread.orig/dvdread_internal.h 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
289 +++ dvdread/dvdread_internal.h 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
290 @@ -2,11 +2,7 @@ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
291 #define DVDREAD_INTERNAL_H |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
292 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
293 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
294 -#define CHECK_VALUE(arg) \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
295 - if(!(arg)) { \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
296 - fprintf(stderr, "\n*** libdvdread: CHECK_VALUE failed in %s:%i ***" \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
297 - "\n*** for %s ***\n\n", \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
298 - __FILE__, __LINE__, # arg ); \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
299 - } |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
300 +#define CHECK_VALUE(arg) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
301 + |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
302 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
303 #endif /* DVDREAD_INTERNAL_H */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
304 diff -Naur dvdread.orig/dvd_udf.c dvdread/dvd_udf.c |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
305 --- dvdread.orig/dvd_udf.c 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
306 +++ dvdread/dvd_udf.c 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
307 @@ -33,7 +37,9 @@ |
14937 | 308 #include <stdio.h> |
309 #include <stdlib.h> | |
310 #include <string.h> | |
311 +#ifndef __MINGW32__ | |
312 #include <sys/ioctl.h> | |
313 +#endif | |
314 #include <sys/types.h> | |
315 #include <sys/stat.h> | |
316 #include <unistd.h> | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
317 diff -Naur dvdread.orig/ifo_print.c dvdread/ifo_print.c |
16659 | 318 --- dvdread.orig/ifo_print.c 30 Jun 2005 22:48:26 -0000 1.4 |
319 +++ dvdread/ifo_print.c 3 Oct 2005 14:29:01 -0000 1.5 | |
320 @@ -761,14 +761,14 @@ | |
321 ifoPrint_USER_OPS(&pgc->prohibited_ops); | |
322 | |
323 for(i = 0; i < 8; i++) { | |
324 - if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */ | |
325 + if(pgc->audio_control[i].present) { | |
326 printf("Audio stream %i control: %04x\n", | |
327 i, pgc->audio_control[i]); | |
328 } | |
329 } | |
330 | |
331 for(i = 0; i < 32; i++) { | |
332 - if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */ | |
333 + if(pgc->subp_control[i].present) { | |
334 printf("Subpicture stream %2i control: %08x\n", | |
335 i, pgc->subp_control[i]); | |
336 } | |
337 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
338 diff -Naur dvdread.orig/ifo_print.h dvdread/ifo_print.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
339 diff -Naur dvdread.orig/ifo_read.c dvdread/ifo_read.c |
16659 | 340 --- dvdread.orig/ifo_read.c 30 Jun 2005 22:48:26 -0000 1.4 |
341 +++ dvdread/ifo_read.c 3 Oct 2005 14:29:01 -0000 1.5 | |
342 @@ -638,10 +638,6 @@ | |
343 B2N_16(pgc->cell_playback_offset); | |
344 B2N_16(pgc->cell_position_offset); | |
345 | |
346 - for(i = 0; i < 8; i++) | |
347 - B2N_16(pgc->audio_control[i]); | |
348 - for(i = 0; i < 32; i++) | |
349 - B2N_32(pgc->subp_control[i]); | |
350 for(i = 0; i < 16; i++) | |
351 B2N_32(pgc->palette[i]); | |
352 | |
353 @@ -650,10 +646,10 @@ | |
354 | |
355 /* verify time (look at print_time) */ | |
356 for(i = 0; i < 8; i++) | |
357 - if(!pgc->audio_control[i] & 0x8000) /* The 'is present' bit */ | |
358 + if(!pgc->audio_control[i].present) | |
359 CHECK_ZERO(pgc->audio_control[i]); | |
360 for(i = 0; i < 32; i++) | |
361 - if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */ | |
362 + if(!pgc->subp_control[i].present) | |
363 CHECK_ZERO(pgc->subp_control[i]); | |
364 | |
365 /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */ | |
366 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
367 diff -Naur dvdread.orig/ifo_read.h dvdread/ifo_read.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
368 --- dvdread.orig/ifo_read.h 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
369 +++ dvdread/ifo_read.h 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
370 @@ -20,8 +24,8 @@ |
14937 | 371 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
372 */ | |
373 | |
374 -#include <dvdread/ifo_types.h> | |
375 -#include <dvdread/dvd_reader.h> | |
376 +#include "ifo_types.h" | |
377 +#include "dvd_reader.h" | |
378 | |
379 #ifdef __cplusplus | |
380 extern "C" { | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
381 diff -Naur dvdread.orig/ifo_types.h dvdread/ifo_types.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
382 --- dvdread.orig/ifo_types.h 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
383 +++ dvdread/ifo_types.h 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
384 @@ -21,7 +25,7 @@ |
14937 | 385 */ |
386 | |
387 #include <inttypes.h> | |
388 -#include <dvdread/dvd_reader.h> | |
389 +#include "dvd_reader.h" | |
390 | |
391 | |
392 #undef ATTRIBUTE_PACKED | |
16659 | 393 @@ -398,6 +398,55 @@ |
394 } ATTRIBUTE_PACKED user_ops_t; | |
395 | |
396 /** | |
397 + * Subpicture stream mapping for a subtitle | |
398 + */ | |
399 +typedef struct { | |
400 +#ifdef WORDS_BIGENDIAN | |
401 + unsigned int present : 1; | |
402 + unsigned int zero1 : 2; | |
403 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */ | |
404 + | |
405 + unsigned int zero2 : 3; | |
406 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */ | |
407 + | |
408 + unsigned int zero3 : 3; | |
409 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */ | |
410 + | |
411 + unsigned int zero4 : 3; | |
412 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */ | |
413 +#else | |
414 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */ | |
415 + unsigned int zero1 : 2; | |
416 + unsigned int present : 1; | |
417 + | |
418 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */ | |
419 + unsigned int zero2 : 3; | |
420 + | |
421 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */ | |
422 + unsigned int zero3 : 3; | |
423 + | |
424 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */ | |
425 + unsigned int zero4 : 3; | |
426 +#endif | |
427 +} ATTRIBUTE_PACKED subp_mapping_t; | |
428 + | |
429 +/** | |
430 + * Audio stream mapping for a soundtrack | |
431 + */ | |
432 +typedef struct { | |
433 +#ifdef WORDS_BIGENDIAN | |
434 + unsigned int present : 1; | |
435 + unsigned int zero1 : 4; | |
436 + unsigned int s_audio : 3; | |
437 +#else | |
438 + unsigned int s_audio : 3; | |
439 + unsigned int zero1 : 4; | |
440 + unsigned int present : 1; | |
441 +#endif | |
442 + uint8_t zero2; | |
443 +} ATTRIBUTE_PACKED audio_mapping_t; | |
444 + | |
445 +/** | |
446 * Program Chain Information. | |
447 */ | |
448 typedef struct { | |
449 @@ -406,8 +455,8 @@ | |
450 uint8_t nr_of_cells; | |
451 dvd_time_t playback_time; | |
452 user_ops_t prohibited_ops; | |
453 - uint16_t audio_control[8]; /* New type? */ | |
454 - uint32_t subp_control[32]; /* New type? */ | |
455 + audio_mapping_t audio_control[8]; | |
456 + subp_mapping_t subp_control[32]; | |
457 uint16_t next_pgc_nr; | |
458 uint16_t prev_pgc_nr; | |
459 uint16_t goup_pgc_nr; | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
460 diff -Naur dvdread.orig/nav_print.c dvdread/nav_print.c |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
461 diff -Naur dvdread.orig/nav_print.h dvdread/nav_print.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
462 --- dvdread.orig/nav_print.h 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
463 +++ dvdread/nav_print.h 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
464 @@ -20,7 +24,7 @@ |
14937 | 465 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
466 */ | |
467 | |
468 -#include <dvdread/nav_types.h> | |
469 +#include "nav_types.h" | |
470 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
471 /** |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
472 * Pretty printing of the NAV packets, PCI and DSI structs. |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
473 diff -Naur dvdread.orig/nav_read.c dvdread/nav_read.c |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
474 diff -Naur dvdread.orig/nav_read.h dvdread/nav_read.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
475 --- dvdread.orig/nav_read.h 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
476 +++ dvdread/nav_read.h 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
477 @@ -19,7 +23,7 @@ |
14937 | 478 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
479 */ | |
480 | |
481 -#include <dvdread/nav_types.h> | |
482 +#include "nav_types.h" | |
483 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
484 /** |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
485 * Parsing of NAV data, PCI and DSI parts. |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
486 diff -Naur dvdread.orig/nav_types.h dvdread/nav_types.h |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
487 --- dvdread.orig/nav_types.h 2005-06-23 00:18:54.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
488 +++ dvdread/nav_types.h 2005-06-23 00:19:10.000000000 +0200 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
489 @@ -30,7 +34,7 @@ |
14937 | 490 */ |
491 | |
492 #include <inttypes.h> | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
493 -#include <dvdread/ifo_types.h> /* only dvd_time_t, vm_cmd_t and user_ops_t */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
494 +#include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */ |
14937 | 495 |
496 | |
497 #undef ATTRIBUTE_PACKED |