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