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