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