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