Mercurial > mplayer.hg
annotate dvdread/libdvdread_changes.diff @ 24054:6e218aef8e05
Sync local diff with current version.
author | diego |
---|---|
date | Wed, 15 Aug 2007 12:25:39 +0000 |
parents | ae0f4c4e4d9d |
children | 5b9dcfa2d0f0 |
rev | line source |
---|---|
24054 | 1 --- dvdread.orig/bswap.h 2005-09-19 16:14:34.000000000 +0200 |
2 +++ dvdread/bswap.h 2007-08-06 12:45:06.000000000 +0200 | |
3 @@ -76,13 +80,51 @@ | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
4 #define B2N_32(x) x = be32toh(x) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
5 #define B2N_64(x) x = be64toh(x) |
14937 | 6 |
7 +#elif defined(ARCH_X86) | |
8 +inline static unsigned short bswap_16(unsigned short x) | |
9 +{ | |
10 + __asm("xchgb %b0,%h0" : | |
11 + "=q" (x) : | |
12 + "0" (x)); | |
13 + return x; | |
14 +} | |
15 +#define B2N_16(x) x = bswap_16(x) | |
16 + | |
17 +inline static unsigned int bswap_32(unsigned int x) | |
18 +{ | |
19 + __asm( | |
21592
ae0f4c4e4d9d
__CPU__ will be x86-64 under amd64 and fail the check "#if __CPU__ > 386".
diego
parents:
20983
diff
changeset
|
20 +#if __CPU__ != 386 |
14937 | 21 + "bswap %0": |
22 + "=r" (x) : | |
23 +#else | |
24 + "xchgb %b0,%h0\n" | |
25 + " rorl $16,%0\n" | |
26 + " xchgb %b0,%h0": | |
27 + "=q" (x) : | |
28 +#endif | |
29 + "0" (x)); | |
30 + return x; | |
31 +} | |
32 +#define B2N_32(x) x = bswap_32(x) | |
33 + | |
34 +inline static unsigned long long int bswap_64(unsigned long long int x) | |
35 +{ | |
36 + register union { __extension__ uint64_t __ll; | |
37 + uint32_t __l[2]; } __x; | |
38 + asm("xchgl %0,%1": | |
39 + "=r"(__x.__l[0]),"=r"(__x.__l[1]): | |
40 + "0"(bswap_32((unsigned long)x)),"1"(bswap_32((unsigned long)(x>>32)))); | |
41 + return __x.__ll; | |
42 +} | |
43 +#define B2N_64(x) x = bswap_64(x) | |
44 + | |
45 /* This is a slow but portable implementation, it has multiple evaluation | |
46 * problems so beware. | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
47 * Old FreeBSD's and Solaris don't have <byteswap.h> or any other such |
14937 | 48 * functionality! |
49 */ | |
50 | |
24054 | 51 -#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX) |
52 +#elif defined(__FreeBSD__) || defined(__sun) || defined(__bsdi__) || defined(WIN32) || defined(__BEOS__) || defined(__INTERIX) || defined(__CYGWIN__) | |
53 #define B2N_16(x) \ | |
54 x = ((((x) & 0xff00) >> 8) | \ | |
55 (((x) & 0x00ff) << 8)) | |
56 | |
57 --- dvdread.orig/dvd_reader.c 2007-08-06 13:34:37.000000000 +0200 | |
58 +++ dvdread/dvd_reader.c 2007-08-06 13:35:19.000000000 +0200 | |
59 @@ -33,18 +37,30 @@ | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
60 #include <limits.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
61 #include <dirent.h> |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
62 |
24054 | 63 -#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined(__bsdi__) || defined(__DARWIN__) |
17311 | 64 +#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
|
65 #define SYS_BSD 1 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
66 #endif |
14937 | 67 |
68 #if defined(__sun) | |
69 #include <sys/mnttab.h> | |
70 +#elif defined(hpux) | |
71 +#include </usr/conf/h/mnttab.h> | |
72 #elif defined(SYS_BSD) | |
73 #include <fstab.h> | |
15535 | 74 -#elif defined(__linux__) |
75 +#elif defined(__linux__) || defined(__CYGWIN__) | |
14937 | 76 #include <mntent.h> |
77 #endif | |
78 | |
18910 | 79 +#if defined(__MINGW32__) && (__MINGW32_MAJOR_VERSION <= 3) && (__MINGW32_MINOR_VERSION < 10) |
14937 | 80 +#include <sys/timeb.h> |
81 +static void gettimeofday(struct timeval* t,void* timezone){ | |
82 + struct timeb timebuffer; | |
83 + ftime( &timebuffer ); | |
84 + t->tv_sec=timebuffer.time; | |
85 + t->tv_usec=1000*timebuffer.millitm; | |
86 +} | |
87 +#endif | |
88 + | |
24054 | 89 #include "dvd_reader.h" |
14937 | 90 #include "dvd_input.h" |
24054 | 91 #include "dvd_udf.h" |
92 @@ -52,7 +68,7 @@ | |
93 | |
94 #include "dvdread_internal.h" | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
95 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
96 -#define DEFAULT_UDF_CACHE_LEVEL 1 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
97 +#define DEFAULT_UDF_CACHE_LEVEL 0 |
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 struct dvd_reader_s { |
24054 | 100 /* Basic information. */ |
101 @@ -402,6 +418,11 @@ | |
16510 | 102 Darwin /dev/rdisk0, it needs to be the raw device |
103 BSD/OS /dev/sr0c (if not mounted) or /dev/rsr0c ('c' any letter will do) */ | |
104 static char *bsd_block2char( const char *path ) | |
105 +#if defined(__FreeBSD__) | |
106 +{ | |
107 + return (char *) strdup( path ); | |
108 +} | |
109 +#else | |
110 { | |
24054 | 111 char *new_path; |
14937 | 112 |
24054 | 113 @@ -416,6 +437,7 @@ |
14937 | 114 |
24054 | 115 return new_path; |
16510 | 116 } |
117 +#endif /* __FreeBSD__ */ | |
118 #endif | |
119 | |
14937 | 120 |
24054 | 121 @@ -481,7 +503,7 @@ |
122 char *path_copy; | |
15535 | 123 #if defined(SYS_BSD) |
24054 | 124 struct fstab* fe; |
15535 | 125 -#elif defined(__sun) || defined(__linux__) |
126 +#elif defined(__sun) || defined(__linux__) || defined(__CYGWIN__) | |
24054 | 127 FILE *mntfile; |
15535 | 128 #endif |
129 | |
24054 | 130 @@ -585,7 +607,7 @@ |
131 } | |
132 fclose( mntfile ); | |
133 } | |
15535 | 134 -#elif defined(__linux__) |
135 +#elif defined(__linux__) || defined(__CYGWIN__) | |
24054 | 136 mntfile = fopen( MOUNTED, "r" ); |
137 if( mntfile ) { | |
138 struct mntent *me; | |
139 @@ -610,6 +632,9 @@ | |
140 } | |
141 fclose( mntfile ); | |
142 } | |
143 +#elif defined(__MINGW32__) | |
144 + dev_name = strdup(path); | |
145 + auth_drive = DVDOpenImageFile( path, have_css ); | |
14937 | 146 #endif |
24054 | 147 if( !dev_name ) { |
148 if(verbose >= 1) { | |
149 @@ -828,8 +853,8 @@ | |
150 } | |
14937 | 151 |
24054 | 152 if( dvd->css_state == 1 /* Need key init */ ) { |
153 - initAllCSSKeys( dvd ); | |
154 - dvd->css_state = 2; | |
155 +// initAllCSSKeys( dvd ); | |
156 +// dvd->css_state = 2; | |
157 } | |
158 /* | |
159 if( dvdinput_title( dvd_file->dvd->dev, (int)start ) < 0 ) { | |
160 | |
161 --- dvdread.orig/dvdread_internal.h 2005-09-12 21:42:12.000000000 +0200 | |
162 +++ dvdread/dvdread_internal.h 2007-08-06 12:57:08.000000000 +0200 | |
163 @@ -3,12 +3,7 @@ | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
164 #define DVDREAD_INTERNAL_H |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
165 |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
166 |
24054 | 167 -#define CHECK_VALUE(arg) \ |
168 - if(!(arg)) { \ | |
169 - fprintf(stderr, "\n*** libdvdread: CHECK_VALUE failed in %s:%i ***" \ | |
170 - "\n*** for %s ***\n\n", \ | |
171 - __FILE__, __LINE__, # arg ); \ | |
172 - } | |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
173 +#define CHECK_VALUE(arg) |
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
174 |
24054 | 175 |
176 int get_verbose(void); | |
177 | |
178 --- dvdread.orig/ifo_print.c 2005-09-15 18:54:29.000000000 +0200 | |
179 +++ dvdread/ifo_print.c 2007-08-06 12:52:32.000000000 +0200 | |
180 @@ -793,14 +797,14 @@ | |
16659 | 181 ifoPrint_USER_OPS(&pgc->prohibited_ops); |
182 | |
24054 | 183 for(i = 0; i < 8; i++) { |
184 - if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */ | |
185 + if(pgc->audio_control[i].present) { /* The 'is present' bit */ | |
186 printf("Audio stream %i control: %04x\n", | |
187 i, pgc->audio_control[i]); | |
16659 | 188 } |
24054 | 189 } |
16659 | 190 |
191 for(i = 0; i < 32; i++) { | |
192 - if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */ | |
24054 | 193 + if(pgc->subp_control[i].present) { /* The 'is present' bit */ |
16659 | 194 printf("Subpicture stream %2i control: %08x\n", |
24054 | 195 i, pgc->subp_control[i]); |
16659 | 196 } |
197 | |
24054 | 198 --- dvdread.orig/ifo_read.c 2006-01-22 13:19:19.000000000 +0100 |
199 +++ dvdread/ifo_read.c 2007-08-06 13:15:55.000000000 +0200 | |
200 @@ -110,7 +114,7 @@ | |
20790 | 201 ifo_handle_t *ifoOpen(dvd_reader_t *dvd, int title) { |
202 ifo_handle_t *ifofile; | |
203 | |
204 - ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); | |
205 + ifofile = malloc(sizeof(ifo_handle_t)); | |
206 if(!ifofile) | |
24054 | 207 return NULL; |
20790 | 208 |
24054 | 209 @@ -240,7 +244,7 @@ |
20790 | 210 ifo_handle_t *ifoOpenVMGI(dvd_reader_t *dvd) { |
211 ifo_handle_t *ifofile; | |
212 | |
213 - ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); | |
214 + ifofile = malloc(sizeof(ifo_handle_t)); | |
215 if(!ifofile) | |
24054 | 216 return NULL; |
20790 | 217 |
24054 | 218 @@ -292,7 +296,7 @@ |
20790 | 219 ifo_handle_t *ifoOpenVTSI(dvd_reader_t *dvd, int title) { |
220 ifo_handle_t *ifofile; | |
221 | |
222 - ifofile = (ifo_handle_t *)malloc(sizeof(ifo_handle_t)); | |
223 + ifofile = malloc(sizeof(ifo_handle_t)); | |
224 if(!ifofile) | |
24054 | 225 return NULL; |
20790 | 226 |
24054 | 227 @@ -382,7 +386,7 @@ |
20790 | 228 static int ifoRead_VMG(ifo_handle_t *ifofile) { |
229 vmgi_mat_t *vmgi_mat; | |
230 | |
231 - vmgi_mat = (vmgi_mat_t *)malloc(sizeof(vmgi_mat_t)); | |
232 + vmgi_mat = malloc(sizeof(vmgi_mat_t)); | |
233 if(!vmgi_mat) | |
234 return 0; | |
235 | |
24054 | 236 @@ -473,7 +477,7 @@ |
20790 | 237 vtsi_mat_t *vtsi_mat; |
238 int i; | |
239 | |
240 - vtsi_mat = (vtsi_mat_t *)malloc(sizeof(vtsi_mat_t)); | |
241 + vtsi_mat = malloc(sizeof(vtsi_mat_t)); | |
242 if(!vtsi_mat) | |
243 return 0; | |
244 | |
24054 | 245 @@ -606,7 +610,7 @@ |
246 | |
20790 | 247 if(cmd_tbl->nr_of_pre != 0) { |
248 unsigned int pre_cmds_size = cmd_tbl->nr_of_pre * COMMAND_DATA_SIZE; | |
249 - cmd_tbl->pre_cmds = (vm_cmd_t *)malloc(pre_cmds_size); | |
250 + cmd_tbl->pre_cmds = malloc(pre_cmds_size); | |
251 if(!cmd_tbl->pre_cmds) | |
252 return 0; | |
253 | |
24054 | 254 @@ -618,7 +622,7 @@ |
255 | |
20790 | 256 if(cmd_tbl->nr_of_post != 0) { |
257 unsigned int post_cmds_size = cmd_tbl->nr_of_post * COMMAND_DATA_SIZE; | |
258 - cmd_tbl->post_cmds = (vm_cmd_t *)malloc(post_cmds_size); | |
259 + cmd_tbl->post_cmds = malloc(post_cmds_size); | |
260 if(!cmd_tbl->post_cmds) { | |
261 if(cmd_tbl->pre_cmds) | |
24054 | 262 free(cmd_tbl->pre_cmds); |
263 @@ -634,7 +638,7 @@ | |
20790 | 264 |
265 if(cmd_tbl->nr_of_cell != 0) { | |
266 unsigned int cell_cmds_size = cmd_tbl->nr_of_cell * COMMAND_DATA_SIZE; | |
267 - cmd_tbl->cell_cmds = (vm_cmd_t *)malloc(cell_cmds_size); | |
268 + cmd_tbl->cell_cmds = malloc(cell_cmds_size); | |
269 if(!cmd_tbl->cell_cmds) { | |
270 if(cmd_tbl->pre_cmds) | |
24054 | 271 free(cmd_tbl->pre_cmds); |
272 @@ -751,10 +755,6 @@ | |
16659 | 273 B2N_16(pgc->cell_playback_offset); |
274 B2N_16(pgc->cell_position_offset); | |
275 | |
276 - for(i = 0; i < 8; i++) | |
277 - B2N_16(pgc->audio_control[i]); | |
278 - for(i = 0; i < 32; i++) | |
279 - B2N_32(pgc->subp_control[i]); | |
280 for(i = 0; i < 16; i++) | |
281 B2N_32(pgc->palette[i]); | |
282 | |
24054 | 283 @@ -763,10 +763,10 @@ |
16659 | 284 |
285 /* verify time (look at print_time) */ | |
286 for(i = 0; i < 8; i++) | |
287 - if(!pgc->audio_control[i] & 0x8000) /* The 'is present' bit */ | |
288 + if(!pgc->audio_control[i].present) | |
289 CHECK_ZERO(pgc->audio_control[i]); | |
290 for(i = 0; i < 32; i++) | |
291 - if(!pgc->subp_control[i] & 0x80000000) /* The 'is present' bit */ | |
292 + if(!pgc->subp_control[i].present) | |
293 CHECK_ZERO(pgc->subp_control[i]); | |
294 | |
295 /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */ | |
24054 | 296 @@ -880,7 +880,7 @@ |
20790 | 297 if(ifofile->vmgi_mat->first_play_pgc == 0) |
298 return 1; | |
299 | |
300 - ifofile->first_play_pgc = (pgc_t *)malloc(sizeof(pgc_t)); | |
301 + ifofile->first_play_pgc = malloc(sizeof(pgc_t)); | |
302 if(!ifofile->first_play_pgc) | |
303 return 0; | |
304 | |
24054 | 305 @@ -934,7 +934,7 @@ |
20790 | 306 if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->tt_srpt * DVD_BLOCK_LEN)) |
307 return 0; | |
308 | |
309 - tt_srpt = (tt_srpt_t *)malloc(sizeof(tt_srpt_t)); | |
310 + tt_srpt = malloc(sizeof(tt_srpt_t)); | |
311 if(!tt_srpt) | |
312 return 0; | |
313 | |
24054 | 314 @@ -953,7 +953,7 @@ |
20790 | 315 |
316 info_length = tt_srpt->last_byte + 1 - TT_SRPT_SIZE; | |
317 | |
318 - tt_srpt->title = (title_info_t *)malloc(info_length); | |
24054 | 319 + tt_srpt->title = malloc(info_length); |
20790 | 320 if(!tt_srpt->title) { |
321 free(tt_srpt); | |
322 ifofile->tt_srpt = 0; | |
24054 | 323 @@ -1040,7 +1040,7 @@ |
324 ifofile->vtsi_mat->vts_ptt_srpt * DVD_BLOCK_LEN)) | |
20790 | 325 return 0; |
326 | |
327 - vts_ptt_srpt = (vts_ptt_srpt_t *)malloc(sizeof(vts_ptt_srpt_t)); | |
328 + vts_ptt_srpt = malloc(sizeof(vts_ptt_srpt_t)); | |
329 if(!vts_ptt_srpt) | |
330 return 0; | |
331 | |
24054 | 332 @@ -1063,7 +1063,7 @@ |
20790 | 333 |
334 info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE; | |
335 | |
336 - data = (uint32_t *)malloc(info_length); | |
24054 | 337 + data = malloc(info_length); |
20790 | 338 if(!data) { |
339 free(vts_ptt_srpt); | |
340 ifofile->vts_ptt_srpt = 0; | |
24054 | 341 @@ -1183,7 +1183,7 @@ |
20790 | 342 if(!DVDFileSeek_(ifofile->file, ifofile->vmgi_mat->ptl_mait * DVD_BLOCK_LEN)) |
343 return 0; | |
344 | |
345 - ptl_mait = (ptl_mait_t *)malloc(sizeof(ptl_mait_t)); | |
346 + ptl_mait = malloc(sizeof(ptl_mait_t)); | |
347 if(!ptl_mait) | |
348 return 0; | |
349 | |
24054 | 350 @@ -1207,7 +1207,7 @@ |
351 <= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE); | |
20790 | 352 |
353 info_length = ptl_mait->nr_of_countries * sizeof(ptl_mait_country_t); | |
354 - ptl_mait->countries = (ptl_mait_country_t *)malloc(info_length); | |
355 + ptl_mait->countries = malloc(info_length); | |
356 if(!ptl_mait->countries) { | |
357 free(ptl_mait); | |
358 ifofile->ptl_mait = 0; | |
24054 | 359 @@ -1252,7 +1252,7 @@ |
20790 | 360 return 0; |
361 } | |
362 info_length = (ptl_mait->nr_of_vtss + 1) * sizeof(pf_level_t); | |
363 - pf_temp = (uint16_t *)malloc(info_length); | |
364 + pf_temp = malloc(info_length); | |
365 if(!pf_temp) { | |
366 for(j = 0; j < i ; j++) { | |
24054 | 367 free(ptl_mait->countries[j].pf_ptl_mai); |
368 @@ -1276,7 +1276,7 @@ | |
20790 | 369 for (j = 0; j < ((ptl_mait->nr_of_vtss + 1) * 8); j++) { |
24054 | 370 B2N_16(pf_temp[j]); |
20790 | 371 } |
372 - ptl_mait->countries[i].pf_ptl_mai = (pf_level_t *)malloc(info_length); | |
373 + ptl_mait->countries[i].pf_ptl_mai = malloc(info_length); | |
374 if(!ptl_mait->countries[i].pf_ptl_mai) { | |
375 free(pf_temp); | |
376 for(j = 0; j < i ; j++) { | |
24054 | 377 @@ -1340,7 +1340,7 @@ |
20790 | 378 if(!DVDFileSeek_(ifofile->file, offset)) |
379 return 0; | |
380 | |
381 - vts_tmapt = (vts_tmapt_t *)malloc(sizeof(vts_tmapt_t)); | |
382 + vts_tmapt = malloc(sizeof(vts_tmapt_t)); | |
383 if(!vts_tmapt) | |
384 return 0; | |
385 | |
24054 | 386 @@ -1362,7 +1362,7 @@ |
20790 | 387 |
388 info_length = vts_tmapt->nr_of_tmaps * 4; | |
389 | |
390 - vts_tmap_srp = (uint32_t *)malloc(info_length); | |
391 + vts_tmap_srp = malloc(info_length); | |
392 if(!vts_tmap_srp) { | |
393 free(vts_tmapt); | |
394 ifofile->vts_tmapt = NULL; | |
24054 | 395 @@ -1388,7 +1388,7 @@ |
20790 | 396 |
397 info_length = vts_tmapt->nr_of_tmaps * sizeof(vts_tmap_t); | |
398 | |
399 - vts_tmapt->tmap = (vts_tmap_t *)malloc(info_length); | |
400 + vts_tmapt->tmap = malloc(info_length); | |
401 if(!vts_tmapt->tmap) { | |
402 free(vts_tmap_srp); | |
403 free(vts_tmapt); | |
24054 | 404 @@ -1422,7 +1422,7 @@ |
20790 | 405 |
406 info_length = vts_tmapt->tmap[i].nr_of_entries * sizeof(map_ent_t); | |
407 | |
408 - vts_tmapt->tmap[i].map_ent = (map_ent_t *)malloc(info_length); | |
409 + vts_tmapt->tmap[i].map_ent = malloc(info_length); | |
410 if(!vts_tmapt->tmap[i].map_ent) { | |
411 ifoFree_VTS_TMAPT(ifofile); | |
412 return 0; | |
24054 | 413 @@ -1472,7 +1472,7 @@ |
20790 | 414 if(ifofile->vtsi_mat->vts_c_adt == 0) /* mandatory */ |
415 return 0; | |
416 | |
417 - ifofile->vts_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t)); | |
418 + ifofile->vts_c_adt = malloc(sizeof(c_adt_t)); | |
419 if(!ifofile->vts_c_adt) | |
420 return 0; | |
421 | |
24054 | 422 @@ -1504,7 +1504,7 @@ |
20790 | 423 return 0; |
424 } | |
425 | |
426 - ifofile->menu_c_adt = (c_adt_t *)malloc(sizeof(c_adt_t)); | |
427 + ifofile->menu_c_adt = malloc(sizeof(c_adt_t)); | |
428 if(!ifofile->menu_c_adt) | |
429 return 0; | |
430 | |
24054 | 431 @@ -1548,7 +1548,7 @@ |
20790 | 432 c_adt->nr_of_vobs = info_length / sizeof(cell_adr_t); |
433 } | |
434 | |
435 - c_adt->cell_adr_table = (cell_adr_t *)malloc(info_length); | |
436 + c_adt->cell_adr_table = malloc(info_length); | |
437 if(!c_adt->cell_adr_table) | |
438 return 0; | |
439 | |
24054 | 440 @@ -1608,7 +1608,7 @@ |
20790 | 441 if(ifofile->vtsi_mat->vts_vobu_admap == 0) /* mandatory */ |
442 return 0; | |
443 | |
444 - ifofile->vts_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t)); | |
445 + ifofile->vts_vobu_admap = malloc(sizeof(vobu_admap_t)); | |
446 if(!ifofile->vts_vobu_admap) | |
447 return 0; | |
448 | |
24054 | 449 @@ -1640,7 +1640,7 @@ |
20790 | 450 return 0; |
451 } | |
452 | |
453 - ifofile->menu_vobu_admap = (vobu_admap_t *)malloc(sizeof(vobu_admap_t)); | |
454 + ifofile->menu_vobu_admap = malloc(sizeof(vobu_admap_t)); | |
455 if(!ifofile->menu_vobu_admap) | |
456 return 0; | |
457 | |
24054 | 458 @@ -1673,7 +1673,7 @@ |
20790 | 459 Titles with a VOBS that has no VOBUs. */ |
460 CHECK_VALUE(info_length % sizeof(uint32_t) == 0); | |
461 | |
462 - vobu_admap->vobu_start_sectors = (uint32_t *)malloc(info_length); | |
24054 | 463 + vobu_admap->vobu_start_sectors = malloc(info_length); |
20790 | 464 if(!vobu_admap->vobu_start_sectors) { |
465 return 0; | |
466 } | |
24054 | 467 @@ -1725,7 +1725,7 @@ |
20790 | 468 if(ifofile->vtsi_mat->vts_pgcit == 0) /* mandatory */ |
469 return 0; | |
470 | |
471 - ifofile->vts_pgcit = (pgcit_t *)malloc(sizeof(pgcit_t)); | |
472 + ifofile->vts_pgcit = malloc(sizeof(pgcit_t)); | |
473 if(!ifofile->vts_pgcit) | |
474 return 0; | |
475 | |
24054 | 476 @@ -1860,7 +1860,7 @@ |
20790 | 477 return 0; |
478 } | |
479 | |
480 - ifofile->pgci_ut = (pgci_ut_t *)malloc(sizeof(pgci_ut_t)); | |
481 + ifofile->pgci_ut = malloc(sizeof(pgci_ut_t)); | |
482 if(!ifofile->pgci_ut) | |
483 return 0; | |
484 | |
24054 | 485 @@ -2050,7 +2050,7 @@ |
20790 | 486 if(!DVDFileSeek_(ifofile->file, sector * DVD_BLOCK_LEN)) |
487 return 0; | |
488 | |
489 - vts_atrt = (vts_atrt_t *)malloc(sizeof(vts_atrt_t)); | |
490 + vts_atrt = malloc(sizeof(vts_atrt_t)); | |
491 if(!vts_atrt) | |
492 return 0; | |
493 | |
24054 | 494 @@ -2072,7 +2072,7 @@ |
495 VTS_ATRT_SIZE < vts_atrt->last_byte + 1); | |
20790 | 496 |
497 info_length = vts_atrt->nr_of_vtss * sizeof(uint32_t); | |
498 - data = (uint32_t *)malloc(info_length); | |
499 + data = malloc(info_length); | |
500 if(!data) { | |
501 free(vts_atrt); | |
502 ifofile->vts_atrt = 0; | |
24054 | 503 @@ -2094,7 +2094,7 @@ |
20790 | 504 } |
505 | |
506 info_length = vts_atrt->nr_of_vtss * sizeof(vts_attributes_t); | |
507 - vts_atrt->vts = (vts_attributes_t *)malloc(info_length); | |
508 + vts_atrt->vts = malloc(info_length); | |
509 if(!vts_atrt->vts) { | |
510 free(data); | |
511 free(vts_atrt); | |
24054 | 512 @@ -2150,7 +2150,7 @@ |
513 ifofile->vmgi_mat->txtdt_mgi * DVD_BLOCK_LEN)) | |
20790 | 514 return 0; |
515 | |
516 - txtdt_mgi = (txtdt_mgi_t *)malloc(sizeof(txtdt_mgi_t)); | |
517 + txtdt_mgi = malloc(sizeof(txtdt_mgi_t)); | |
518 if(!txtdt_mgi) { | |
519 return 0; | |
520 } | |
16659 | 521 |
15875
50960b929dd0
update mplayer specific libdvdread diff to match v0.9.4
aurel
parents:
15535
diff
changeset
|
522 --- 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
|
523 +++ dvdread/ifo_types.h 2005-06-23 00:19:10.000000000 +0200 |
24054 | 524 @@ -403,6 +407,55 @@ |
16659 | 525 } ATTRIBUTE_PACKED user_ops_t; |
526 | |
527 /** | |
528 + * Subpicture stream mapping for a subtitle | |
529 + */ | |
530 +typedef struct { | |
531 +#ifdef WORDS_BIGENDIAN | |
532 + unsigned int present : 1; | |
533 + unsigned int zero1 : 2; | |
534 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */ | |
535 + | |
536 + unsigned int zero2 : 3; | |
537 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */ | |
538 + | |
539 + unsigned int zero3 : 3; | |
540 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */ | |
541 + | |
542 + unsigned int zero4 : 3; | |
543 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */ | |
544 +#else | |
545 + unsigned int s_4p3 : 5; /* stream for 4:3 on any display */ | |
546 + unsigned int zero1 : 2; | |
547 + unsigned int present : 1; | |
548 + | |
549 + unsigned int s_wide : 5; /* stream for 16:9 on widescreen display */ | |
550 + unsigned int zero2 : 3; | |
551 + | |
552 + unsigned int s_lbox : 5; /* stream for 16:9 on letterboxed 4:3 display */ | |
553 + unsigned int zero3 : 3; | |
554 + | |
555 + unsigned int s_panscan : 5; /* stream for 16:9 with pan&scan data on 4:3 display */ | |
556 + unsigned int zero4 : 3; | |
557 +#endif | |
558 +} ATTRIBUTE_PACKED subp_mapping_t; | |
559 + | |
560 +/** | |
561 + * Audio stream mapping for a soundtrack | |
562 + */ | |
563 +typedef struct { | |
564 +#ifdef WORDS_BIGENDIAN | |
565 + unsigned int present : 1; | |
566 + unsigned int zero1 : 4; | |
567 + unsigned int s_audio : 3; | |
568 +#else | |
569 + unsigned int s_audio : 3; | |
570 + unsigned int zero1 : 4; | |
571 + unsigned int present : 1; | |
572 +#endif | |
573 + uint8_t zero2; | |
574 +} ATTRIBUTE_PACKED audio_mapping_t; | |
575 + | |
576 +/** | |
577 * Program Chain Information. | |
578 */ | |
579 typedef struct { | |
24054 | 580 @@ -411,8 +464,8 @@ |
16659 | 581 uint8_t nr_of_cells; |
582 dvd_time_t playback_time; | |
583 user_ops_t prohibited_ops; | |
584 - uint16_t audio_control[8]; /* New type? */ | |
585 - uint32_t subp_control[32]; /* New type? */ | |
586 + audio_mapping_t audio_control[8]; | |
587 + subp_mapping_t subp_control[32]; | |
588 uint16_t next_pgc_nr; | |
589 uint16_t prev_pgc_nr; | |
590 uint16_t goup_pgc_nr; |