Mercurial > mplayer.hg
annotate libdvdread/libdvdread_changes.diff @ 20787:11731a2cbc11
Revert nonsensical local change hunk that had no effect at all.
author | diego |
---|---|
date | Wed, 08 Nov 2006 23:08:41 +0000 |
parents | 1a4fcea7ab53 |
children | 94c424e7974f |
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 |
18371 | 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) | |
18371 | 13 @@ -59,13 +61,57 @@ |
15875
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 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
73 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
|
74 --- 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
|
75 +++ dvdread/dvd_input.c 2005-06-23 00:30:23.000000000 +0200 |
18371 | 76 @@ -37,7 +41,7 @@ |
14937 | 77 |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
78 #ifdef HAVE_DVDCSS_DVDCSS_H |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
79 /* linking to libdvdcss */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
80 -#include <dvdcss/dvdcss.h> |
19820
e5d97c5f3c32
Move dvdcss.h to a dvdcss subdirectory, just like upstream libdvdcss does.
diego
parents:
18910
diff
changeset
|
81 +#include "dvdcss/dvdcss.h" |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
82 #define DVDcss_open(a) dvdcss_open((char*)(a)) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
83 #define DVDcss_close dvdcss_close |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
84 #define DVDcss_seek dvdcss_seek |
18371 | 85 @@ -74,7 +78,7 @@ |
14937 | 86 dvd_input_t dev; |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
87 |
14937 | 88 /* Allocate the handle structure */ |
89 - dev = (dvd_input_t) malloc(sizeof(dvd_input_t)); | |
90 + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s)); | |
91 if(dev == NULL) { | |
92 fprintf(stderr, "libdvdread: Could not allocate memory.\n"); | |
93 return NULL; | |
18371 | 94 @@ -154,7 +158,7 @@ |
17786
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
95 dvd_input_t dev; |
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
96 |
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
97 /* Allocate the library structure */ |
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
98 - dev = (dvd_input_t) malloc(sizeof(dvd_input_t)); |
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
99 + dev = (dvd_input_t) malloc(sizeof(struct dvd_input_s)); |
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
100 if(dev == NULL) { |
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
101 fprintf(stderr, "libdvdread: Could not allocate memory.\n"); |
f0f54034c7e9
fix another sizeof(dvd_input_t) bug (must be struct dvd_input_s instead)
reimar
parents:
17313
diff
changeset
|
102 return NULL; |
18371 | 103 @@ -320,8 +324,10 @@ |
14937 | 104 fprintf(stderr, "DVDCSS_METHOD %s\n", psz_method); |
105 fprintf(stderr, "DVDCSS_VERBOSE %s\n", psz_verbose); | |
106 */ | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
107 + /* |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
108 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
|
109 *dvdcss_version); |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
110 + */ |
14937 | 111 |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
112 /* libdvdcss wrapper functions */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
113 dvdinput_open = css_open; |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
114 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
|
115 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
|
116 --- 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
|
117 +++ dvdread/dvd_reader.c 2005-06-23 00:19:10.000000000 +0200 |
18371 | 118 @@ -32,24 +36,36 @@ |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
119 #include <limits.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
120 #include <dirent.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
121 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
122 -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__)|| defined(__DARWIN__) |
17311 | 123 +#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__) || defined(__DragonFly__) |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
124 #define SYS_BSD 1 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
125 #endif |
14937 | 126 |
127 #if defined(__sun) | |
128 #include <sys/mnttab.h> | |
129 +#elif defined(hpux) | |
130 +#include </usr/conf/h/mnttab.h> | |
131 #elif defined(SYS_BSD) | |
132 #include <fstab.h> | |
15535 | 133 -#elif defined(__linux__) |
134 +#elif defined(__linux__) || defined(__CYGWIN__) | |
14937 | 135 #include <mntent.h> |
136 #endif | |
137 | |
18910 | 138 +#if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION <= 3) && (__MINGW32_MINOR_VERSION < 10) |
14937 | 139 +#include <sys/timeb.h> |
140 +static void gettimeofday(struct timeval* t,void* timezone){ | |
141 + struct timeb timebuffer; | |
142 + ftime( &timebuffer ); | |
143 + t->tv_sec=timebuffer.time; | |
144 + t->tv_usec=1000*timebuffer.millitm; | |
145 +} | |
146 +#endif | |
147 + | |
148 #include "dvd_udf.h" | |
149 #include "dvd_input.h" | |
150 #include "dvd_reader.h" | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
151 #include "md5.h" |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
152 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
153 -#define DEFAULT_UDF_CACHE_LEVEL 1 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
154 +#define DEFAULT_UDF_CACHE_LEVEL 0 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
155 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
156 struct dvd_reader_s { |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
157 /* Basic information. */ |
18371 | 158 @@ -278,11 +301,16 @@ |
16510 | 159 Darwin /dev/rdisk0, it needs to be the raw device |
160 BSD/OS /dev/sr0c (if not mounted) or /dev/rsr0c ('c' any letter will do) */ | |
161 static char *bsd_block2char( const char *path ) | |
162 +#if defined(__FreeBSD__) | |
163 +{ | |
164 + return (char *) strdup( path ); | |
165 +} | |
166 +#else | |
167 { | |
14937 | 168 char *new_path; |
169 | |
170 /* If it doesn't start with "/dev/" or does start with "/dev/r" exit */ | |
171 - if( !strncmp( path, "/dev/", 5 ) || strncmp( path, "/dev/r", 6 ) ) | |
172 + if( strncmp( path, "/dev/", 5 ) || !strncmp( path, "/dev/r", 6 ) ) | |
173 return (char *) strdup( path ); | |
174 | |
175 /* Replace "/dev/" with "/dev/r" */ | |
18371 | 176 @@ -292,6 +320,7 @@ |
16510 | 177 |
178 return new_path; | |
179 } | |
180 +#endif /* __FreeBSD__ */ | |
181 #endif | |
182 | |
183 dvd_reader_t *DVDOpen( const char *path ) | |
18371 | 184 @@ -303,6 +332,16 @@ |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
185 if( path == NULL ) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
186 return 0; |
14937 | 187 |
188 +#ifdef WIN32 | |
189 + /* Stat doesn't work on devices under mingwin/cygwin. */ | |
190 + if( path[0] && path[1] == ':' && path[2] == '\0' ) | |
191 + { | |
192 + /* Don't try to stat the file */ | |
193 + fileinfo.st_mode = S_IFBLK; | |
194 + } | |
195 + else | |
196 +#endif | |
197 + { | |
198 ret = stat( path, &fileinfo ); | |
199 if( ret < 0 ) { | |
200 /* If we can't stat the file, give up */ | |
18371 | 201 @@ -310,6 +349,7 @@ |
14937 | 202 perror(""); |
203 return 0; | |
204 } | |
205 + } | |
206 | |
207 /* 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
|
208 have_css = dvdinput_setup(); |
18371 | 209 @@ -335,7 +375,7 @@ |
15535 | 210 char *path_copy; |
211 #if defined(SYS_BSD) | |
212 struct fstab* fe; | |
213 -#elif defined(__sun) || defined(__linux__) | |
214 +#elif defined(__sun) || defined(__linux__) || defined(__CYGWIN__) | |
215 FILE *mntfile; | |
216 #endif | |
217 | |
18371 | 218 @@ -350,7 +390,9 @@ |
14937 | 219 if( cdir >= 0 ) { |
220 chdir( path_copy ); | |
221 new_path = getcwd( NULL, PATH_MAX ); | |
222 +#ifndef __MINGW32__ | |
223 fchdir( cdir ); | |
224 +#endif | |
225 close( cdir ); | |
226 if( new_path ) { | |
227 free( path_copy ); | |
18371 | 228 @@ -406,7 +448,7 @@ |
15535 | 229 } |
230 fclose( mntfile ); | |
231 } | |
232 -#elif defined(__linux__) | |
233 +#elif defined(__linux__) || defined(__CYGWIN__) | |
234 mntfile = fopen( MOUNTED, "r" ); | |
235 if( mntfile ) { | |
236 struct mntent *me; | |
18371 | 237 @@ -425,6 +467,9 @@ |
14937 | 238 } |
239 fclose( mntfile ); | |
240 } | |
15535 | 241 +#elif defined(__MINGW32__) |
14937 | 242 + dev_name = strdup(path); |
243 + auth_drive = DVDOpenImageFile( path, have_css ); | |
244 #endif | |
245 if( !dev_name ) { | |
246 fprintf( stderr, "libdvdread: Couldn't find device name.\n" ); | |
18371 | 247 @@ -615,8 +660,8 @@ |
14937 | 248 } |
249 | |
250 if( dvd->css_state == 1 /* Need key init */ ) { | |
251 - initAllCSSKeys( dvd ); | |
252 - dvd->css_state = 2; | |
253 +// initAllCSSKeys( dvd ); | |
254 +// dvd->css_state = 2; | |
255 } | |
256 /* | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
257 if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) { |
18371 | 258 @@ -915,7 +960,7 @@ |
14937 | 259 return (ssize_t)ret; |
260 } | |
261 | |
262 -int32_t DVDFileSeek( dvd_file_t *dvd_file, int32_t offset ) | |
263 +int DVDFileSeek( dvd_file_t *dvd_file, int offset ) | |
264 { | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
265 /* Check arguments. */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
266 if( dvd_file == NULL || offset < 0 ) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
267 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
|
268 --- 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
|
269 +++ 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
|
270 @@ -2,11 +2,7 @@ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
271 #define DVDREAD_INTERNAL_H |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
272 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
273 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
274 -#define CHECK_VALUE(arg) \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
275 - if(!(arg)) { \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
276 - 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
|
277 - "\n*** for %s ***\n\n", \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
278 - __FILE__, __LINE__, # arg ); \ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
279 - } |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
280 +#define CHECK_VALUE(arg) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
281 + |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
282 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
283 #endif /* DVDREAD_INTERNAL_H */ |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
284 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
|
285 --- 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
|
286 +++ dvdread/dvd_udf.c 2005-06-23 00:19:10.000000000 +0200 |
18371 | 287 @@ -33,7 +37,9 @@ |
14937 | 288 #include <stdio.h> |
289 #include <stdlib.h> | |
290 #include <string.h> | |
291 +#ifndef __MINGW32__ | |
292 #include <sys/ioctl.h> | |
293 +#endif | |
294 #include <sys/types.h> | |
295 #include <sys/stat.h> | |
296 #include <unistd.h> | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
297 diff -Naur dvdread.orig/ifo_print.c dvdread/ifo_print.c |
16659 | 298 --- dvdread.orig/ifo_print.c 30 Jun 2005 22:48:26 -0000 1.4 |
299 +++ dvdread/ifo_print.c 3 Oct 2005 14:29:01 -0000 1.5 | |
300 @@ -761,14 +761,14 @@ | |
301 ifoPrint_USER_OPS(&pgc->prohibited_ops); | |
302 | |
303 for(i = 0; i < 8; i++) { | |
304 - if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */ | |
305 + if(pgc->audio_control[i].present) { | |
306 printf("Audio stream %i control: %04x\n", | |
307 i, pgc->audio_control[i]); | |
308 } | |
309 } | |
310 | |
311 for(i = 0; i < 32; i++) { | |
312 - if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */ | |
313 + if(pgc->subp_control[i].present) { | |
314 printf("Subpicture stream %2i control: %08x\n", | |
315 i, pgc->subp_control[i]); | |
316 } | |
317 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
318 diff -Naur dvdread.orig/ifo_print.h dvdread/ifo_print.h |
20615
1a4fcea7ab53
libmpdvdkit2 --> libdvdread, it just contains libdvdread now.
diego
parents:
19820
diff
changeset
|
319 --- dvdread.orig/ifo_print.h 2002-08-15 22:13:21.000000000 +0200 |
1a4fcea7ab53
libmpdvdkit2 --> libdvdread, it just contains libdvdread now.
diego
parents:
19820
diff
changeset
|
320 +++ dvdread/ifo_print.h 2005-12-29 13:13:21.000000000 +0100 |
18371 | 321 @@ -20,8 +24,8 @@ |
17311 | 322 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
323 */ | |
324 | |
325 -#include <dvdread/ifo_types.h> | |
326 -#include <dvdread/dvd_reader.h> | |
327 +#include "ifo_types.h" | |
328 +#include "dvd_reader.h" | |
329 | |
330 #ifdef __cplusplus | |
331 extern "C" { | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
332 diff -Naur dvdread.orig/ifo_read.c dvdread/ifo_read.c |
16659 | 333 --- dvdread.orig/ifo_read.c 30 Jun 2005 22:48:26 -0000 1.4 |
334 +++ dvdread/ifo_read.c 3 Oct 2005 14:29:01 -0000 1.5 | |
335 @@ -638,10 +638,6 @@ | |
336 B2N_16(pgc->cell_playback_offset); | |
337 B2N_16(pgc->cell_position_offset); | |
338 | |
339 - for(i = 0; i < 8; i++) | |
340 - B2N_16(pgc->audio_control[i]); | |
341 - for(i = 0; i < 32; i++) | |
342 - B2N_32(pgc->subp_control[i]); | |
343 for(i = 0; i < 16; i++) | |
344 B2N_32(pgc->palette[i]); | |
345 | |
346 @@ -650,10 +646,10 @@ | |
347 | |
348 /* verify time (look at print_time) */ | |
349 for(i = 0; i < 8; i++) | |
350 - if(!pgc->audio_control[i] & 0x8000) /* The 'is present' bit */ | |
351 + if(!pgc->audio_control[i].present) | |
352 CHECK_ZERO(pgc->audio_control[i]); | |
353 for(i = 0; i < 32; i++) | |
354 - if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */ | |
355 + if(!pgc->subp_control[i].present) | |
356 CHECK_ZERO(pgc->subp_control[i]); | |
357 | |
358 /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */ | |
359 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
360 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
|
361 --- 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
|
362 +++ dvdread/ifo_read.h 2005-06-23 00:19:10.000000000 +0200 |
18371 | 363 @@ -20,8 +24,8 @@ |
14937 | 364 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
365 */ | |
366 | |
367 -#include <dvdread/ifo_types.h> | |
368 -#include <dvdread/dvd_reader.h> | |
369 +#include "ifo_types.h" | |
370 +#include "dvd_reader.h" | |
371 | |
372 #ifdef __cplusplus | |
373 extern "C" { | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
374 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
|
375 --- 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
|
376 +++ dvdread/ifo_types.h 2005-06-23 00:19:10.000000000 +0200 |
18371 | 377 @@ -21,7 +25,7 @@ |
14937 | 378 */ |
379 | |
380 #include <inttypes.h> | |
381 -#include <dvdread/dvd_reader.h> | |
382 +#include "dvd_reader.h" | |
383 | |
384 | |
385 #undef ATTRIBUTE_PACKED | |
18371 | 386 @@ -394,6 +398,55 @@ |
16659 | 387 } ATTRIBUTE_PACKED user_ops_t; |
388 | |
389 /** | |
390 + * Subpicture stream mapping for a subtitle | |
391 + */ | |
392 +typedef struct { | |
393 +#ifdef WORDS_BIGENDIAN | |
394 + unsigned int present : 1; | |
395 + unsigned int zero1 : 2; | |
396 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */ | |
397 + | |
398 + unsigned int zero2 : 3; | |
399 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */ | |
400 + | |
401 + unsigned int zero3 : 3; | |
402 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */ | |
403 + | |
404 + unsigned int zero4 : 3; | |
405 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */ | |
406 +#else | |
407 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */ | |
408 + unsigned int zero1 : 2; | |
409 + unsigned int present : 1; | |
410 + | |
411 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */ | |
412 + unsigned int zero2 : 3; | |
413 + | |
414 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */ | |
415 + unsigned int zero3 : 3; | |
416 + | |
417 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */ | |
418 + unsigned int zero4 : 3; | |
419 +#endif | |
420 +} ATTRIBUTE_PACKED subp_mapping_t; | |
421 + | |
422 +/** | |
423 + * Audio stream mapping for a soundtrack | |
424 + */ | |
425 +typedef struct { | |
426 +#ifdef WORDS_BIGENDIAN | |
427 + unsigned int present : 1; | |
428 + unsigned int zero1 : 4; | |
429 + unsigned int s_audio : 3; | |
430 +#else | |
431 + unsigned int s_audio : 3; | |
432 + unsigned int zero1 : 4; | |
433 + unsigned int present : 1; | |
434 +#endif | |
435 + uint8_t zero2; | |
436 +} ATTRIBUTE_PACKED audio_mapping_t; | |
437 + | |
438 +/** | |
439 * Program Chain Information. | |
440 */ | |
441 typedef struct { | |
18371 | 442 @@ -402,8 +455,8 @@ |
16659 | 443 uint8_t nr_of_cells; |
444 dvd_time_t playback_time; | |
445 user_ops_t prohibited_ops; | |
446 - uint16_t audio_control[8]; /* New type? */ | |
447 - uint32_t subp_control[32]; /* New type? */ | |
448 + audio_mapping_t audio_control[8]; | |
449 + subp_mapping_t subp_control[32]; | |
450 uint16_t next_pgc_nr; | |
451 uint16_t prev_pgc_nr; | |
452 uint16_t goup_pgc_nr; | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
453 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
|
454 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
|
455 --- 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
|
456 +++ dvdread/nav_print.h 2005-06-23 00:19:10.000000000 +0200 |
18371 | 457 @@ -20,7 +24,7 @@ |
14937 | 458 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
459 */ | |
460 | |
461 -#include <dvdread/nav_types.h> | |
462 +#include "nav_types.h" | |
463 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
464 /** |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
465 * 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
|
466 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
|
467 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
|
468 --- 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
|
469 +++ dvdread/nav_read.h 2005-06-23 00:19:10.000000000 +0200 |
18371 | 470 @@ -19,7 +23,7 @@ |
14937 | 471 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
472 */ | |
473 | |
474 -#include <dvdread/nav_types.h> | |
475 +#include "nav_types.h" | |
476 | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
477 /** |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
478 * Parsing of NAV data, PCI and DSI parts. |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
479 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
|
480 --- 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
|
481 +++ dvdread/nav_types.h 2005-06-23 00:19:10.000000000 +0200 |
18371 | 482 @@ -30,7 +34,7 @@ |
14937 | 483 */ |
484 | |
485 #include <inttypes.h> | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
486 -#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
|
487 +#include "ifo_types.h" /* only dvd_time_t, vm_cmd_t and user_ops_t */ |
14937 | 488 |
489 | |
490 #undef ATTRIBUTE_PACKED |