Mercurial > libdvdread4.hg
annotate ifo_print.c @ 63:46c05a214511 src
Inhibit double free of parental management information
If reading the country data fails the point to the parental
management information is not nulled out. So it is possible for
the same structure to be freed twice. To inhibit this whenever
the country data read fails the structure pointer is assigned
null. Patch submitted by Frederic Marchal, fmarchal at
perso dot be. Thanks for being patient and reworking the patch
when requested.
author | erik |
---|---|
date | Sun, 30 Jan 2011 23:44:09 +0000 |
parents | aa36b2d85f8d |
children | 06fed92263cd |
rev | line source |
---|---|
20 | 1 /* |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
2 * This file is part of libdvdread. |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
3 * |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
4 * libdvdread is free software; you can redistribute it and/or modify |
3 | 5 * it under the terms of the GNU General Public License as published by |
6 * the Free Software Foundation; either version 2 of the License, or | |
7 * (at your option) any later version. | |
8 * | |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
9 * libdvdread is distributed in the hope that it will be useful, |
3 | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 * GNU General Public License for more details. | |
13 * | |
21
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
14 * You should have received a copy of the GNU General Public License along |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
15 * with libdvdread; if not, write to the Free Software Foundation, Inc., |
4aa618ae094f
Use consistent license headers everywhere: Fix FSF address and boilerplate.
diego
parents:
20
diff
changeset
|
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
3 | 17 */ |
18 | |
19 #include <stdio.h> | |
20 #include <stdlib.h> | |
21 #include <unistd.h> | |
22 #include <inttypes.h> | |
23 #include <string.h> | |
24 #include <ctype.h> | |
25 #include <assert.h> | |
26 | |
33
c743d79f187b
Move installed headers into dvdread directory to make them easier to
reimar
parents:
29
diff
changeset
|
27 #include "dvdread/ifo_types.h" |
c743d79f187b
Move installed headers into dvdread directory to make them easier to
reimar
parents:
29
diff
changeset
|
28 #include "dvdread/ifo_read.h" |
c743d79f187b
Move installed headers into dvdread directory to make them easier to
reimar
parents:
29
diff
changeset
|
29 #include "dvdread/ifo_print.h" |
3 | 30 |
31 /* Put this in some other file / package? It's used in nav_print too. */ | |
32 static void ifo_print_time(int level, dvd_time_t *dtime) { | |
33 const char *rate; | |
34 assert((dtime->hour>>4) < 0xa && (dtime->hour&0xf) < 0xa); | |
35 assert((dtime->minute>>4) < 0x7 && (dtime->minute&0xf) < 0xa); | |
36 assert((dtime->second>>4) < 0x7 && (dtime->second&0xf) < 0xa); | |
37 assert((dtime->frame_u&0xf) < 0xa); | |
20 | 38 |
39 printf("%02x:%02x:%02x.%02x", | |
26 | 40 dtime->hour, |
41 dtime->minute, | |
42 dtime->second, | |
43 dtime->frame_u & 0x3f); | |
3 | 44 switch((dtime->frame_u & 0xc0) >> 6) { |
45 case 1: | |
46 rate = "25.00"; | |
47 break; | |
48 case 3: | |
49 rate = "29.97"; | |
50 break; | |
51 default: | |
20 | 52 if(dtime->hour == 0 && dtime->minute == 0 |
3 | 53 && dtime->second == 0 && dtime->frame_u == 0) |
54 rate = "no"; | |
55 else | |
56 rate = "(please send a bug report)"; | |
57 break; | |
20 | 58 } |
3 | 59 printf(" @ %s fps", rate); |
60 } | |
61 | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
62 void dvdread_print_time(dvd_time_t *dtime) { |
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
63 ifo_print_time(5, dtime); |
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
64 } |
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
65 |
3 | 66 /* Put this in some other file / package? It's used in nav_print too. |
67 Possibly also by the vm / navigator. */ | |
68 static void ifo_print_cmd(int row, vm_cmd_t *command) { | |
69 int i; | |
70 | |
71 printf("(%03d) ", row + 1); | |
72 for(i=0;i<8;i++) | |
73 printf("%02x ", command->bytes[i]); | |
74 printf("| "); | |
75 #if 0 | |
76 //disabled call of dvdnav function | |
77 vm_print_mnemonic(command); | |
78 #endif | |
79 printf("\n"); | |
80 } | |
81 | |
82 static void ifo_print_video_attributes(int level, video_attr_t *attr) { | |
20 | 83 |
3 | 84 /* The following test is shorter but not correct ISO C, |
85 memcmp(attr,my_friendly_zeros, sizeof(video_attr_t)) */ | |
20 | 86 if(attr->mpeg_version == 0 |
87 && attr->video_format == 0 | |
88 && attr->display_aspect_ratio == 0 | |
89 && attr->permitted_df == 0 | |
90 && attr->unknown1 == 0 | |
91 && attr->line21_cc_1 == 0 | |
92 && attr->line21_cc_2 == 0 | |
93 && attr->video_format == 0 | |
94 && attr->letterboxed == 0 | |
3 | 95 && attr->film_mode == 0) { |
96 printf("-- Unspecified --"); | |
97 return; | |
98 } | |
20 | 99 |
3 | 100 switch(attr->mpeg_version) { |
101 case 0: | |
102 printf("mpeg1, "); | |
103 break; | |
104 case 1: | |
105 printf("mpeg2, "); | |
106 break; | |
107 default: | |
108 printf("(please send a bug report), "); | |
109 } | |
20 | 110 |
3 | 111 switch(attr->video_format) { |
112 case 0: | |
113 printf("ntsc, "); | |
114 break; | |
115 case 1: | |
116 printf("pal, "); | |
117 break; | |
118 default: | |
119 printf("(please send a bug report), "); | |
120 } | |
20 | 121 |
3 | 122 switch(attr->display_aspect_ratio) { |
123 case 0: | |
124 printf("4:3, "); | |
125 break; | |
126 case 3: | |
127 printf("16:9, "); | |
128 break; | |
129 default: | |
130 printf("(please send a bug report), "); | |
131 } | |
20 | 132 |
35 | 133 // Wide is always allowed..!!! |
3 | 134 switch(attr->permitted_df) { |
135 case 0: | |
136 printf("pan&scan+letterboxed, "); | |
137 break; | |
138 case 1: | |
139 printf("only pan&scan, "); //?? | |
140 break; | |
141 case 2: | |
142 printf("only letterboxed, "); | |
143 break; | |
144 case 3: | |
145 printf("not specified, "); | |
146 break; | |
147 default: | |
148 printf("(please send a bug report), "); | |
149 } | |
20 | 150 |
3 | 151 printf("U%x, ", attr->unknown1); |
152 assert(!attr->unknown1); | |
20 | 153 |
3 | 154 if(attr->line21_cc_1 || attr->line21_cc_2) { |
155 printf("NTSC CC "); | |
156 if(attr->line21_cc_1) | |
157 printf("1, "); | |
158 if(attr->line21_cc_2) | |
159 printf("2, "); | |
160 } | |
20 | 161 |
3 | 162 { |
163 int height = 480; | |
20 | 164 if(attr->video_format != 0) |
3 | 165 height = 576; |
166 switch(attr->picture_size) { | |
167 case 0: | |
168 printf("720x%d, ", height); | |
169 break; | |
170 case 1: | |
171 printf("704x%d, ", height); | |
172 break; | |
173 case 2: | |
174 printf("352x%d, ", height); | |
175 break; | |
176 case 3: | |
177 printf("352x%d, ", height/2); | |
20 | 178 break; |
3 | 179 default: |
180 printf("(please send a bug report), "); | |
181 } | |
182 } | |
183 | |
184 if(attr->letterboxed) { | |
185 printf("source letterboxed, "); | |
186 } | |
20 | 187 |
3 | 188 if(attr->film_mode) { |
189 printf("film. "); | |
190 } else { | |
191 printf("video. "); //camera | |
192 } | |
193 } | |
194 | |
195 static void ifo_print_audio_attributes(int level, audio_attr_t *attr) { | |
20 | 196 |
3 | 197 if(attr->audio_format == 0 |
198 && attr->multichannel_extension == 0 | |
199 && attr->lang_type == 0 | |
200 && attr->application_mode == 0 | |
201 && attr->quantization == 0 | |
202 && attr->sample_frequency == 0 | |
203 && attr->channels == 0 | |
204 && attr->lang_extension == 0 | |
205 && attr->unknown1 == 0 | |
206 && attr->unknown3 == 0) { | |
207 printf("-- Unspecified --"); | |
208 return; | |
209 } | |
20 | 210 |
3 | 211 switch(attr->audio_format) { |
212 case 0: | |
213 printf("ac3 "); | |
214 if(attr->quantization != 3) | |
215 printf("(please send a bug report) ac3 quant/drc not 3 (%d)", attr->quantization); | |
216 break; | |
217 case 1: | |
218 printf("(please send a bug report) "); | |
219 break; | |
220 case 2: | |
221 printf("mpeg1 "); | |
222 case 3: | |
223 printf("mpeg2ext "); | |
224 switch(attr->quantization) { | |
27
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
225 case 0: |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
226 printf("no drc "); |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
227 break; |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
228 case 1: |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
229 printf("drc "); |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
230 break; |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
231 default: |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
232 printf("(please send a bug report) mpeg reserved quant/drc (%d)", attr->quantization); |
3 | 233 } |
234 break; | |
235 case 4: | |
236 printf("lpcm "); | |
237 switch(attr->quantization) { | |
27
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
238 case 0: |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
239 printf("16bit "); |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
240 break; |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
241 case 1: |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
242 printf("20bit "); |
3 | 243 break; |
27
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
244 case 2: |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
245 printf("24bit "); |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
246 break; |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
247 case 3: |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
248 printf("(please send a bug report) lpcm reserved quant/drc (%d)", attr->quantization); |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
249 break; |
3 | 250 } |
251 break; | |
252 case 5: | |
253 printf("(please send a bug report) "); | |
254 break; | |
255 case 6: | |
256 printf("dts "); | |
257 if(attr->quantization != 3) | |
258 printf("(please send a bug report) dts quant/drc not 3 (%d)", attr->quantization); | |
259 break; | |
260 default: | |
261 printf("(please send a bug report) "); | |
262 } | |
20 | 263 |
3 | 264 if(attr->multichannel_extension) |
265 printf("multichannel_extension "); | |
20 | 266 |
3 | 267 switch(attr->lang_type) { |
268 case 0: | |
269 // not specified | |
270 assert(attr->lang_code == 0 || attr->lang_code == 0xffff); | |
271 break; | |
272 case 1: | |
273 printf("%c%c ", attr->lang_code>>8, attr->lang_code & 0xff); | |
274 break; | |
275 default: | |
276 printf("(please send a bug report) "); | |
277 } | |
278 | |
279 switch(attr->application_mode) { | |
280 case 0: | |
281 // not specified | |
282 break; | |
283 case 1: | |
284 printf("karaoke mode "); | |
285 break; | |
286 case 2: | |
287 printf("surround sound mode "); | |
288 break; | |
289 default: | |
290 printf("(please send a bug report) "); | |
291 } | |
20 | 292 |
3 | 293 switch(attr->quantization) { |
294 case 0: | |
295 printf("16bit "); | |
296 break; | |
297 case 1: | |
298 printf("20bit "); | |
299 break; | |
300 case 2: | |
301 printf("24bit "); | |
302 break; | |
303 case 3: | |
304 printf("drc "); | |
305 break; | |
306 default: | |
307 printf("(please send a bug report) "); | |
308 } | |
20 | 309 |
3 | 310 switch(attr->sample_frequency) { |
311 case 0: | |
312 printf("48kHz "); | |
313 break; | |
314 case 1: | |
315 printf("??kHz "); | |
316 break; | |
317 default: | |
20 | 318 printf("sample_frequency %i (please send a bug report) ", |
26 | 319 attr->sample_frequency); |
3 | 320 } |
20 | 321 |
3 | 322 printf("%dCh ", attr->channels + 1); |
20 | 323 |
3 | 324 switch(attr->lang_extension) { |
325 case 0: | |
326 printf("Not specified "); | |
327 break; | |
328 case 1: // Normal audio | |
329 printf("Normal Caption "); | |
330 break; | |
35 | 331 case 2: // visually impaired |
3 | 332 printf("Audio for visually impaired "); |
333 break; | |
334 case 3: // Directors 1 | |
335 printf("Director's comments 1 "); | |
336 break; | |
337 case 4: // Directors 2 | |
338 printf("Director's comments 2 "); | |
339 break; | |
20 | 340 //case 4: // Music score ? |
3 | 341 default: |
342 printf("(please send a bug report) "); | |
343 } | |
20 | 344 |
3 | 345 printf("%d ", attr->unknown1); |
346 printf("%d ", attr->unknown3); | |
347 } | |
348 | |
349 static void ifo_print_subp_attributes(int level, subp_attr_t *attr) { | |
20 | 350 |
3 | 351 if(attr->type == 0 |
352 && attr->lang_code == 0 | |
353 && attr->zero1 == 0 | |
354 && attr->zero2 == 0 | |
355 && attr->lang_extension== 0) { | |
356 printf("-- Unspecified --"); | |
357 return; | |
358 } | |
20 | 359 |
3 | 360 printf("type %02x ", attr->type); |
20 | 361 |
3 | 362 if(isalpha((int)(attr->lang_code >> 8)) |
363 && isalpha((int)(attr->lang_code & 0xff))) { | |
364 printf("%c%c ", attr->lang_code >> 8, attr->lang_code & 0xff); | |
365 } else { | |
20 | 366 printf("%02x%02x ", 0xff & (unsigned)(attr->lang_code >> 8), |
26 | 367 0xff & (unsigned)(attr->lang_code & 0xff)); |
3 | 368 } |
20 | 369 |
3 | 370 printf("%d ", attr->zero1); |
371 printf("%d ", attr->zero2); | |
372 | |
373 switch(attr->lang_extension) { | |
374 case 0: | |
375 printf("Not specified "); | |
376 break; | |
377 case 1: | |
378 printf("Caption with normal size character "); | |
379 break; | |
380 case 2: | |
381 printf("Caption with bigger size character "); | |
382 break; | |
20 | 383 case 3: |
3 | 384 printf("Caption for children "); |
385 break; | |
386 case 4: | |
387 printf("reserved "); | |
388 break; | |
389 case 5: | |
390 printf("Closed Caption with normal size character "); | |
391 break; | |
392 case 6: | |
393 printf("Closed Caption with bigger size character "); | |
394 break; | |
395 case 7: | |
396 printf("Closed Caption for children "); | |
397 break; | |
398 case 8: | |
399 printf("reserved "); | |
400 break; | |
401 case 9: | |
402 printf("Forced Caption"); | |
403 break; | |
404 case 10: | |
405 printf("reserved "); | |
406 break; | |
407 case 11: | |
408 printf("reserved "); | |
409 break; | |
410 case 12: | |
411 printf("reserved "); | |
412 break; | |
413 case 13: | |
414 printf("Director's comments with normal size character "); | |
415 break; | |
416 case 14: | |
417 printf("Director's comments with bigger size character "); | |
418 break; | |
419 case 15: | |
420 printf("Director's comments for children "); | |
421 break; | |
422 default: | |
423 printf("(please send a bug report) "); | |
424 } | |
425 | |
426 } | |
427 | |
428 | |
29 | 429 static void ifoPrint_USER_OPS(user_ops_t *user_ops) { |
3 | 430 uint32_t uops; |
431 unsigned char *ptr = (unsigned char *)user_ops; | |
20 | 432 |
3 | 433 uops = (*ptr++ << 24); |
434 uops |= (*ptr++ << 16); | |
435 uops |= (*ptr++ << 8); | |
436 uops |= (*ptr++); | |
20 | 437 |
3 | 438 if(uops == 0) { |
439 printf("None\n"); | |
440 } else if(uops == 0x01ffffff) { | |
441 printf("All\n"); | |
442 } else { | |
443 if(user_ops->title_or_time_play) | |
444 printf("Title or Time Play, "); | |
445 if(user_ops->chapter_search_or_play) | |
446 printf("Chapter Search or Play, "); | |
447 if(user_ops->title_play) | |
448 printf("Title Play, "); | |
449 if(user_ops->stop) | |
450 printf("Stop, "); | |
451 if(user_ops->go_up) | |
452 printf("Go Up, "); | |
453 if(user_ops->time_or_chapter_search) | |
454 printf("Time or Chapter Search, "); | |
455 if(user_ops->prev_or_top_pg_search) | |
456 printf("Prev or Top PG Search, "); | |
457 if(user_ops->next_pg_search) | |
458 printf("Next PG Search, "); | |
459 if(user_ops->forward_scan) | |
460 printf("Forward Scan, "); | |
461 if(user_ops->backward_scan) | |
462 printf("Backward Scan, "); | |
463 if(user_ops->title_menu_call) | |
464 printf("Title Menu Call, "); | |
465 if(user_ops->root_menu_call) | |
466 printf("Root Menu Call, "); | |
467 if(user_ops->subpic_menu_call) | |
468 printf("SubPic Menu Call, "); | |
469 if(user_ops->audio_menu_call) | |
470 printf("Audio Menu Call, "); | |
471 if(user_ops->angle_menu_call) | |
472 printf("Angle Menu Call, "); | |
473 if(user_ops->chapter_menu_call) | |
474 printf("Chapter Menu Call, "); | |
475 if(user_ops->resume) | |
476 printf("Resume, "); | |
477 if(user_ops->button_select_or_activate) | |
478 printf("Button Select or Activate, "); | |
479 if(user_ops->still_off) | |
480 printf("Still Off, "); | |
481 if(user_ops->pause_on) | |
482 printf("Pause On, "); | |
483 if(user_ops->audio_stream_change) | |
484 printf("Audio Stream Change, "); | |
485 if(user_ops->subpic_stream_change) | |
486 printf("SubPic Stream Change, "); | |
487 if(user_ops->angle_change) | |
488 printf("Angle Change, "); | |
489 if(user_ops->karaoke_audio_pres_mode_change) | |
490 printf("Karaoke Audio Pres Mode Change, "); | |
491 if(user_ops->video_pres_mode_change) | |
492 printf("Video Pres Mode Change, "); | |
493 printf("\n"); | |
494 } | |
495 } | |
496 | |
497 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
498 static void ifoPrint_VMGI_MAT(vmgi_mat_t *vmgi_mat) { |
20 | 499 |
3 | 500 printf("VMG Identifier: %.12s\n", vmgi_mat->vmg_identifier); |
501 printf("Last Sector of VMG: %08x\n", vmgi_mat->vmg_last_sector); | |
502 printf("Last Sector of VMGI: %08x\n", vmgi_mat->vmgi_last_sector); | |
20 | 503 printf("Specification version number: %01x.%01x\n", |
26 | 504 vmgi_mat->specification_version >> 4, |
505 vmgi_mat->specification_version & 0xf); | |
3 | 506 /* Byte 2 of 'VMG Category' (00xx0000) is the Region Code */ |
507 printf("VMG Category: %08x (Region Code=%02x)\n", vmgi_mat->vmg_category, ((vmgi_mat->vmg_category >> 16) & 0xff) ^0xff); | |
508 printf("VMG Number of Volumes: %i\n", vmgi_mat->vmg_nr_of_volumes); | |
509 printf("VMG This Volume: %i\n", vmgi_mat->vmg_this_volume_nr); | |
510 printf("Disc side %i\n", vmgi_mat->disc_side); | |
511 printf("VMG Number of Title Sets %i\n", vmgi_mat->vmg_nr_of_title_sets); | |
512 printf("Provider ID: %.32s\n", vmgi_mat->provider_identifier); | |
513 printf("VMG POS Code: %08x", (uint32_t)(vmgi_mat->vmg_pos_code >> 32)); | |
514 printf("%08x\n", (uint32_t)vmgi_mat->vmg_pos_code); | |
515 printf("End byte of VMGI_MAT: %08x\n", vmgi_mat->vmgi_last_byte); | |
20 | 516 printf("Start byte of First Play PGC (FP PGC): %08x\n", |
26 | 517 vmgi_mat->first_play_pgc); |
3 | 518 printf("Start sector of VMGM_VOBS: %08x\n", vmgi_mat->vmgm_vobs); |
519 printf("Start sector of TT_SRPT: %08x\n", vmgi_mat->tt_srpt); | |
520 printf("Start sector of VMGM_PGCI_UT: %08x\n", vmgi_mat->vmgm_pgci_ut); | |
521 printf("Start sector of PTL_MAIT: %08x\n", vmgi_mat->ptl_mait); | |
522 printf("Start sector of VTS_ATRT: %08x\n", vmgi_mat->vts_atrt); | |
523 printf("Start sector of TXTDT_MG: %08x\n", vmgi_mat->txtdt_mgi); | |
524 printf("Start sector of VMGM_C_ADT: %08x\n", vmgi_mat->vmgm_c_adt); | |
20 | 525 printf("Start sector of VMGM_VOBU_ADMAP: %08x\n", |
26 | 526 vmgi_mat->vmgm_vobu_admap); |
3 | 527 printf("Video attributes of VMGM_VOBS: "); |
528 ifo_print_video_attributes(5, &vmgi_mat->vmgm_video_attr); | |
529 printf("\n"); | |
20 | 530 printf("VMGM Number of Audio attributes: %i\n", |
26 | 531 vmgi_mat->nr_of_vmgm_audio_streams); |
3 | 532 if(vmgi_mat->nr_of_vmgm_audio_streams > 0) { |
533 printf("\tstream %i status: ", 1); | |
534 ifo_print_audio_attributes(5, &vmgi_mat->vmgm_audio_attr); | |
535 printf("\n"); | |
536 } | |
20 | 537 printf("VMGM Number of Sub-picture attributes: %i\n", |
26 | 538 vmgi_mat->nr_of_vmgm_subp_streams); |
3 | 539 if(vmgi_mat->nr_of_vmgm_subp_streams > 0) { |
540 printf("\tstream %2i status: ", 1); | |
541 ifo_print_subp_attributes(5, &vmgi_mat->vmgm_subp_attr); | |
542 printf("\n"); | |
543 } | |
544 } | |
545 | |
546 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
547 static void ifoPrint_VTSI_MAT(vtsi_mat_t *vtsi_mat) { |
3 | 548 int i; |
549 | |
550 printf("VTS Identifier: %.12s\n", vtsi_mat->vts_identifier); | |
551 printf("Last Sector of VTS: %08x\n", vtsi_mat->vts_last_sector); | |
552 printf("Last Sector of VTSI: %08x\n", vtsi_mat->vtsi_last_sector); | |
20 | 553 printf("Specification version number: %01x.%01x\n", |
26 | 554 vtsi_mat->specification_version>>4, |
555 vtsi_mat->specification_version&0xf); | |
3 | 556 printf("VTS Category: %08x\n", vtsi_mat->vts_category); |
557 printf("End byte of VTSI_MAT: %08x\n", vtsi_mat->vtsi_last_byte); | |
558 printf("Start sector of VTSM_VOBS: %08x\n", vtsi_mat->vtsm_vobs); | |
559 printf("Start sector of VTSTT_VOBS: %08x\n", vtsi_mat->vtstt_vobs); | |
560 printf("Start sector of VTS_PTT_SRPT: %08x\n", vtsi_mat->vts_ptt_srpt); | |
561 printf("Start sector of VTS_PGCIT: %08x\n", vtsi_mat->vts_pgcit); | |
562 printf("Start sector of VTSM_PGCI_UT: %08x\n", vtsi_mat->vtsm_pgci_ut); | |
563 printf("Start sector of VTS_TMAPT: %08x\n", vtsi_mat->vts_tmapt); | |
564 printf("Start sector of VTSM_C_ADT: %08x\n", vtsi_mat->vtsm_c_adt); | |
565 printf("Start sector of VTSM_VOBU_ADMAP: %08x\n",vtsi_mat->vtsm_vobu_admap); | |
566 printf("Start sector of VTS_C_ADT: %08x\n", vtsi_mat->vts_c_adt); | |
567 printf("Start sector of VTS_VOBU_ADMAP: %08x\n", vtsi_mat->vts_vobu_admap); | |
568 | |
569 printf("Video attributes of VTSM_VOBS: "); | |
570 ifo_print_video_attributes(5, &vtsi_mat->vtsm_video_attr); | |
571 printf("\n"); | |
20 | 572 |
573 printf("VTSM Number of Audio attributes: %i\n", | |
26 | 574 vtsi_mat->nr_of_vtsm_audio_streams); |
3 | 575 if(vtsi_mat->nr_of_vtsm_audio_streams > 0) { |
576 printf("\tstream %i status: ", 1); | |
577 ifo_print_audio_attributes(5, &vtsi_mat->vtsm_audio_attr); | |
578 printf("\n"); | |
579 } | |
20 | 580 |
581 printf("VTSM Number of Sub-picture attributes: %i\n", | |
26 | 582 vtsi_mat->nr_of_vtsm_subp_streams); |
3 | 583 if(vtsi_mat->nr_of_vtsm_subp_streams > 0) { |
584 printf("\tstream %2i status: ", 1); | |
585 ifo_print_subp_attributes(5, &vtsi_mat->vtsm_subp_attr); | |
586 printf("\n"); | |
587 } | |
20 | 588 |
3 | 589 printf("Video attributes of VTS_VOBS: "); |
590 ifo_print_video_attributes(5, &vtsi_mat->vts_video_attr); | |
591 printf("\n"); | |
20 | 592 |
593 printf("VTS Number of Audio attributes: %i\n", | |
26 | 594 vtsi_mat->nr_of_vts_audio_streams); |
3 | 595 for(i = 0; i < vtsi_mat->nr_of_vts_audio_streams; i++) { |
596 printf("\tstream %i status: ", i); | |
597 ifo_print_audio_attributes(5, &vtsi_mat->vts_audio_attr[i]); | |
598 printf("\n"); | |
599 } | |
20 | 600 |
601 printf("VTS Number of Subpicture attributes: %i\n", | |
26 | 602 vtsi_mat->nr_of_vts_subp_streams); |
3 | 603 for(i = 0; i < vtsi_mat->nr_of_vts_subp_streams; i++) { |
604 printf("\tstream %2i status: ", i); | |
605 ifo_print_subp_attributes(5, &vtsi_mat->vts_subp_attr[i]); | |
606 printf("\n"); | |
607 } | |
608 } | |
609 | |
610 | |
29 | 611 static void ifoPrint_PGC_COMMAND_TBL(pgc_command_tbl_t *cmd_tbl) { |
3 | 612 int i; |
20 | 613 |
3 | 614 if(cmd_tbl == NULL) { |
615 printf("No Command table present\n"); | |
616 return; | |
617 } | |
20 | 618 |
3 | 619 printf("Number of Pre commands: %i\n", cmd_tbl->nr_of_pre); |
620 for(i = 0; i < cmd_tbl->nr_of_pre; i++) { | |
621 ifo_print_cmd(i, &cmd_tbl->pre_cmds[i]); | |
622 } | |
623 | |
624 printf("Number of Post commands: %i\n", cmd_tbl->nr_of_post); | |
625 for(i = 0; i < cmd_tbl->nr_of_post; i++) { | |
626 ifo_print_cmd(i, &cmd_tbl->post_cmds[i]); | |
627 } | |
628 | |
629 printf("Number of Cell commands: %i\n", cmd_tbl->nr_of_cell); | |
630 for(i = 0; i < cmd_tbl->nr_of_cell; i++) { | |
631 ifo_print_cmd(i, &cmd_tbl->cell_cmds[i]); | |
632 } | |
633 } | |
634 | |
635 | |
29 | 636 static void ifoPrint_PGC_PROGRAM_MAP(pgc_program_map_t *program_map, int nr) { |
3 | 637 int i; |
20 | 638 |
3 | 639 if(program_map == NULL) { |
640 printf("No Program map present\n"); | |
641 return; | |
642 } | |
20 | 643 |
3 | 644 for(i = 0; i < nr; i++) { |
645 printf("Program %3i Entry Cell: %3i\n", i + 1, program_map[i]); | |
646 } | |
647 } | |
648 | |
649 | |
29 | 650 static void ifoPrint_CELL_PLAYBACK(cell_playback_t *cell_playback, int nr) { |
3 | 651 int i; |
20 | 652 |
3 | 653 if(cell_playback == NULL) { |
654 printf("No Cell Playback info present\n"); | |
655 return; | |
656 } | |
20 | 657 |
3 | 658 for(i=0;i<nr;i++) { |
659 printf("Cell: %3i ", i + 1); | |
660 | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
661 dvdread_print_time(&cell_playback[i].playback_time); |
3 | 662 printf("\t"); |
663 | |
664 if(cell_playback[i].block_mode || cell_playback[i].block_type) { | |
665 const char *s; | |
666 switch(cell_playback[i].block_mode) { | |
667 case 0: | |
26 | 668 s = "not a"; break; |
3 | 669 case 1: |
26 | 670 s = "the first"; break; |
3 | 671 case 2: |
672 default: | |
26 | 673 s = ""; break; |
3 | 674 case 3: |
26 | 675 s = "last"; break; |
3 | 676 } |
677 printf("%s cell in the block ", s); | |
20 | 678 |
3 | 679 switch(cell_playback[i].block_type) { |
680 case 0: | |
26 | 681 printf("not part of the block "); |
682 break; | |
3 | 683 case 1: |
26 | 684 printf("angle block "); |
685 break; | |
3 | 686 case 2: |
687 case 3: | |
35 | 688 printf("(send bug report) "); |
26 | 689 break; |
3 | 690 } |
691 } | |
692 if(cell_playback[i].seamless_play) | |
693 printf("presented seamlessly "); | |
694 if(cell_playback[i].interleaved) | |
695 printf("cell is interleaved "); | |
696 if(cell_playback[i].stc_discontinuity) | |
697 printf("STC_discontinuty "); | |
698 if(cell_playback[i].seamless_angle) | |
699 printf("only seamless angle "); | |
700 if(cell_playback[i].playback_mode) | |
701 printf("only still VOBUs "); | |
702 if(cell_playback[i].restricted) | |
703 printf("restricted cell "); | |
704 if(cell_playback[i].unknown2) | |
705 printf("Unknown 0x%x ", cell_playback[i].unknown2); | |
706 if(cell_playback[i].still_time) | |
707 printf("still time %d ", cell_playback[i].still_time); | |
708 if(cell_playback[i].cell_cmd_nr) | |
709 printf("cell command %d", cell_playback[i].cell_cmd_nr); | |
20 | 710 |
711 printf("\n\tStart sector: %08x\tFirst ILVU end sector: %08x\n", | |
26 | 712 cell_playback[i].first_sector, |
713 cell_playback[i].first_ilvu_end_sector); | |
20 | 714 printf("\tEnd sector: %08x\tLast VOBU start sector: %08x\n", |
26 | 715 cell_playback[i].last_sector, |
716 cell_playback[i].last_vobu_start_sector); | |
3 | 717 } |
718 } | |
719 | |
29 | 720 static void ifoPrint_CELL_POSITION(cell_position_t *cell_position, int nr) { |
3 | 721 int i; |
20 | 722 |
3 | 723 if(cell_position == NULL) { |
724 printf("No Cell Position info present\n"); | |
725 return; | |
726 } | |
20 | 727 |
3 | 728 for(i=0;i<nr;i++) { |
20 | 729 printf("Cell: %3i has VOB ID: %3i, Cell ID: %3i\n", i + 1, |
26 | 730 cell_position[i].vob_id_nr, cell_position[i].cell_nr); |
3 | 731 } |
732 } | |
733 | |
734 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
735 static void ifoPrint_PGC(pgc_t *pgc) { |
3 | 736 int i; |
20 | 737 |
3 | 738 if (!pgc) { |
739 printf("None\n"); | |
740 return; | |
741 } | |
742 printf("Number of Programs: %i\n", pgc->nr_of_programs); | |
743 printf("Number of Cells: %i\n", pgc->nr_of_cells); | |
744 /* Check that time is 0:0:0:0 also if nr_of_programs==0 */ | |
745 printf("Playback time: "); | |
13
4e610984cc3f
added dvdread_print_time() and removed the file-static print_time() in nav_print.c; based on a patch by Erik Hovland org
nicodvb
parents:
4
diff
changeset
|
746 dvdread_print_time(&pgc->playback_time); printf("\n"); |
3 | 747 |
748 /* If no programs/no time then does this mean anything? */ | |
749 printf("Prohibited user operations: "); | |
29 | 750 ifoPrint_USER_OPS(&pgc->prohibited_ops); |
20 | 751 |
28 | 752 for(i = 0; i < 8; i++) { |
753 if(pgc->audio_control[i] & 0x8000) { /* The 'is present' bit */ | |
754 printf("Audio stream %i control: %04x\n", | |
755 i, pgc->audio_control[i]); | |
3 | 756 } |
28 | 757 } |
20 | 758 |
3 | 759 for(i = 0; i < 32; i++) { |
760 if(pgc->subp_control[i] & 0x80000000) { /* The 'is present' bit */ | |
20 | 761 printf("Subpicture stream %2i control: %08x: 4:3=%d, Wide=%d, Letterbox=%d, Pan-Scan=%d\n", |
26 | 762 i, pgc->subp_control[i], |
763 (pgc->subp_control[i] >>24) & 0x1f, | |
764 (pgc->subp_control[i] >>16) & 0x1f, | |
765 (pgc->subp_control[i] >>8) & 0x1f, | |
766 (pgc->subp_control[i] ) & 0x1f); | |
3 | 767 } |
768 } | |
20 | 769 |
3 | 770 printf("Next PGC number: %i\n", pgc->next_pgc_nr); |
771 printf("Prev PGC number: %i\n", pgc->prev_pgc_nr); | |
772 printf("GoUp PGC number: %i\n", pgc->goup_pgc_nr); | |
773 if(pgc->nr_of_programs != 0) { | |
774 printf("Still time: %i seconds (255=inf)\n", pgc->still_time); | |
775 printf("PG Playback mode %02x\n", pgc->pg_playback_mode); | |
776 } | |
20 | 777 |
3 | 778 if(pgc->nr_of_programs != 0) { |
779 for(i = 0; i < 16; i++) { | |
780 printf("Color %2i: %08x\n", i, pgc->palette[i]); | |
781 } | |
782 } | |
20 | 783 |
35 | 784 /* Memory offsets to div. tables. */ |
29 | 785 ifoPrint_PGC_COMMAND_TBL(pgc->command_tbl); |
786 ifoPrint_PGC_PROGRAM_MAP(pgc->program_map, pgc->nr_of_programs); | |
787 ifoPrint_CELL_PLAYBACK(pgc->cell_playback, pgc->nr_of_cells); | |
788 ifoPrint_CELL_POSITION(pgc->cell_position, pgc->nr_of_cells); | |
3 | 789 } |
790 | |
791 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
792 static void ifoPrint_TT_SRPT(tt_srpt_t *tt_srpt) { |
3 | 793 int i; |
20 | 794 |
3 | 795 printf("Number of TitleTrack search pointers: %i\n", |
26 | 796 tt_srpt->nr_of_srpts); |
3 | 797 for(i=0;i<tt_srpt->nr_of_srpts;i++) { |
798 printf("Title Track index %i\n", i + 1); | |
20 | 799 printf("\tTitle set number (VTS): %i", |
26 | 800 tt_srpt->title[i].title_set_nr); |
3 | 801 printf("\tVTS_TTN: %i\n", tt_srpt->title[i].vts_ttn); |
802 printf("\tNumber of PTTs: %i\n", tt_srpt->title[i].nr_of_ptts); | |
20 | 803 printf("\tNumber of angles: %i\n", |
26 | 804 tt_srpt->title[i].nr_of_angles); |
3 | 805 |
20 | 806 printf("\tTitle playback type: (%02x)\n", |
26 | 807 *(uint8_t *)&(tt_srpt->title[i].pb_ty)); |
3 | 808 printf("\t\t%s\n", |
35 | 809 tt_srpt->title[i].pb_ty.multi_or_random_pgc_title ? "Random or Shuffle" : "Sequential"); |
20 | 810 if (tt_srpt->title[i].pb_ty.jlc_exists_in_cell_cmd) printf("\t\tJump/Link/Call exists in cell cmd\n"); |
3 | 811 if (tt_srpt->title[i].pb_ty.jlc_exists_in_prepost_cmd) printf("\t\tJump/Link/Call exists in pre/post cmd\n"); |
812 if (tt_srpt->title[i].pb_ty.jlc_exists_in_button_cmd) printf("\t\tJump/Link/Call exists in button cmd\n"); | |
813 if (tt_srpt->title[i].pb_ty.jlc_exists_in_tt_dom) printf("\t\tJump/Link/Call exists in tt_dom cmd\n"); | |
814 printf("\t\tTitle or time play:%d\n", tt_srpt->title[i].pb_ty.title_or_time_play); | |
815 printf("\t\tChapter search or play:%d\n", tt_srpt->title[i].pb_ty.chapter_search_or_play); | |
816 | |
817 printf("\tParental ID field: %04x\n", | |
26 | 818 tt_srpt->title[i].parental_id); |
20 | 819 printf("\tTitle set starting sector %08x\n", |
26 | 820 tt_srpt->title[i].title_set_sector); |
3 | 821 } |
822 } | |
823 | |
824 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
825 static void ifoPrint_VTS_PTT_SRPT(vts_ptt_srpt_t *vts_ptt_srpt) { |
3 | 826 int i, j; |
20 | 827 printf(" nr_of_srpts %i last byte %i\n", |
26 | 828 vts_ptt_srpt->nr_of_srpts, |
829 vts_ptt_srpt->last_byte); | |
3 | 830 for(i=0;i<vts_ptt_srpt->nr_of_srpts;i++) { |
831 for(j=0;j<vts_ptt_srpt->title[i].nr_of_ptts;j++) { | |
832 printf("VTS_PTT_SRPT - Title %3i part %3i: PGC: %3i PG: %3i\n", | |
26 | 833 i + 1, j + 1, |
834 vts_ptt_srpt->title[i].ptt[j].pgcn, | |
835 vts_ptt_srpt->title[i].ptt[j].pgn ); | |
3 | 836 } |
837 } | |
838 } | |
839 | |
840 | |
841 static void hexdump(uint8_t *ptr, int len) { | |
842 while(len--) | |
843 printf("%02x ", *ptr++); | |
844 } | |
845 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
846 static void ifoPrint_PTL_MAIT(ptl_mait_t *ptl_mait) { |
3 | 847 int i, j; |
20 | 848 |
3 | 849 printf("Number of Countries: %i\n", ptl_mait->nr_of_countries); |
850 printf("Number of VTSs: %i\n", ptl_mait->nr_of_vtss); | |
851 //printf("Last byte: %i\n", ptl_mait->last_byte); | |
20 | 852 |
3 | 853 for(i = 0; i < ptl_mait->nr_of_countries; i++) { |
20 | 854 printf("Country code: %c%c\n", |
26 | 855 ptl_mait->countries[i].country_code >> 8, |
856 ptl_mait->countries[i].country_code & 0xff); | |
3 | 857 /* |
20 | 858 printf("Start byte: %04x %i\n", |
859 ptl_mait->countries[i].pf_ptl_mai_start_byte, | |
3 | 860 ptl_mait->countries[i].pf_ptl_mai_start_byte); |
861 */ | |
862 /* This seems to be pointing at a array with 8 2byte fields per VTS | |
863 ? and one extra for the menu? always an odd number of VTSs on | |
864 all the dics I tested so it might be padding to even also. | |
865 If it is for the menu it probably the first entry. */ | |
866 for(j=0;j<8;j++) { | |
20 | 867 hexdump( (uint8_t *)ptl_mait->countries - PTL_MAIT_COUNTRY_SIZE |
26 | 868 + ptl_mait->countries[i].pf_ptl_mai_start_byte |
869 + j*(ptl_mait->nr_of_vtss+1)*2, (ptl_mait->nr_of_vtss+1)*2); | |
3 | 870 printf("\n"); |
871 } | |
872 } | |
873 } | |
874 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
875 static void ifoPrint_VTS_TMAPT(vts_tmapt_t *vts_tmapt) { |
3 | 876 unsigned int timeunit; |
877 int i, j; | |
878 | |
879 printf("Number of VTS_TMAPS: %i\n", vts_tmapt->nr_of_tmaps); | |
880 printf("Last byte: %i\n", vts_tmapt->last_byte); | |
881 | |
882 for(i = 0; i < vts_tmapt->nr_of_tmaps; i++) { | |
883 printf("TMAP %i (number matches title PGC number.)\n", i + 1); | |
884 printf(" offset %d relative to VTS_TMAPTI\n", vts_tmapt->tmap_offset[i]); | |
885 printf(" Time unit (seconds): %i\n", vts_tmapt->tmap[i].tmu); | |
886 printf(" Number of entries: %i\n", vts_tmapt->tmap[i].nr_of_entries); | |
887 timeunit = vts_tmapt->tmap[i].tmu; | |
888 for(j = 0; j < vts_tmapt->tmap[i].nr_of_entries; j++) { | |
889 unsigned int ac_time = timeunit * (j + 1); | |
890 printf("Time: %2i:%02i:%02i VOBU Sector: 0x%08x %s\n", | |
891 ac_time / (60 * 60), (ac_time / 60) % 60, ac_time % 60, | |
892 vts_tmapt->tmap[i].map_ent[j] & 0x7fffffff, | |
893 (vts_tmapt->tmap[i].map_ent[j] >> 31) ? "discontinuity" : ""); | |
894 } | |
895 } | |
896 } | |
897 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
898 static void ifoPrint_C_ADT(c_adt_t *c_adt) { |
3 | 899 int i, entries; |
20 | 900 |
3 | 901 printf("Number of VOBs in this VOBS: %i\n", c_adt->nr_of_vobs); |
902 //entries = c_adt->nr_of_vobs; | |
903 entries = (c_adt->last_byte + 1 - C_ADT_SIZE)/sizeof(c_adt_t); | |
20 | 904 |
3 | 905 for(i = 0; i < entries; i++) { |
20 | 906 printf("VOB ID: %3i, Cell ID: %3i ", |
26 | 907 c_adt->cell_adr_table[i].vob_id, c_adt->cell_adr_table[i].cell_id); |
3 | 908 printf("Sector (first): 0x%08x (last): 0x%08x\n", |
26 | 909 c_adt->cell_adr_table[i].start_sector, |
910 c_adt->cell_adr_table[i].last_sector); | |
3 | 911 } |
912 } | |
913 | |
914 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
915 static void ifoPrint_VOBU_ADMAP(vobu_admap_t *vobu_admap) { |
3 | 916 int i, entries; |
20 | 917 |
3 | 918 entries = (vobu_admap->last_byte + 1 - VOBU_ADMAP_SIZE)/4; |
919 for(i = 0; i < entries; i++) { | |
920 printf("VOBU %5i First sector: 0x%08x\n", i + 1, | |
26 | 921 vobu_admap->vobu_start_sectors[i]); |
3 | 922 } |
923 } | |
924 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
925 static const char *ifo_print_menu_name(int type) { |
3 | 926 const char *menu_name; |
927 menu_name=""; | |
928 switch (type) { | |
929 case 2: | |
930 menu_name="Title"; | |
931 break; | |
932 case 3: | |
933 menu_name = "Root"; | |
934 break; | |
935 case 4: | |
936 menu_name = "Sub-Picture"; | |
937 break; | |
938 case 5: | |
939 menu_name = "Audio"; | |
940 break; | |
941 case 6: | |
942 menu_name = "Angle"; | |
943 break; | |
944 case 7: | |
945 menu_name = "PTT (Chapter)"; | |
946 break; | |
947 default: | |
948 menu_name = "Unknown"; | |
949 break; | |
950 } | |
951 return &menu_name[0]; | |
952 } | |
953 | |
954 /* pgc_type=1 for menu, 0 for title. */ | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
955 static void ifoPrint_PGCIT(pgcit_t *pgcit, int pgc_type) { |
3 | 956 int i; |
20 | 957 |
3 | 958 printf("\nNumber of Program Chains: %3i\n", pgcit->nr_of_pgci_srp); |
959 for(i = 0; i < pgcit->nr_of_pgci_srp; i++) { | |
960 printf("\nProgram (PGC): %3i\n", i + 1); | |
961 if (pgc_type) { | |
962 printf("PGC Category: Entry PGC %d, Menu Type=0x%02x:%s (Entry id 0x%02x), ", | |
27
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
963 pgcit->pgci_srp[i].entry_id >> 7, |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
964 pgcit->pgci_srp[i].entry_id & 0xf, |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
965 ifo_print_menu_name(pgcit->pgci_srp[i].entry_id & 0xf), |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
966 pgcit->pgci_srp[i].entry_id); |
3 | 967 } else { |
968 printf("PGC Category: %s VTS_TTN:0x%02x (Entry id 0x%02x), ", | |
27
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
969 pgcit->pgci_srp[i].entry_id >> 7 ? "At Start of" : "During", |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
970 pgcit->pgci_srp[i].entry_id & 0xf, |
98951f8ec89c
cosmetics: Sync indentation and similar changes from libdvdread 0.9.5.
diego
parents:
26
diff
changeset
|
971 pgcit->pgci_srp[i].entry_id); |
3 | 972 } |
973 printf("Parental ID mask 0x%04x\n", pgcit->pgci_srp[i].ptl_id_mask); | |
29 | 974 ifoPrint_PGC(pgcit->pgci_srp[i].pgc); |
3 | 975 } |
976 } | |
977 | |
978 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
979 static void ifoPrint_PGCI_UT(pgci_ut_t *pgci_ut) { |
3 | 980 int i, menu; |
20 | 981 |
3 | 982 printf("Number of Menu Language Units (PGCI_LU): %3i\n", pgci_ut->nr_of_lus); |
983 for(i = 0; i < pgci_ut->nr_of_lus; i++) { | |
984 printf("\nMenu Language Unit %d\n", i+1); | |
985 printf("\nMenu Language Code: %c%c\n", | |
26 | 986 pgci_ut->lu[i].lang_code >> 8, |
987 pgci_ut->lu[i].lang_code & 0xff); | |
20 | 988 |
3 | 989 menu = pgci_ut->lu[i].exists; |
990 printf("Menu Existence: %02x: ", menu); | |
991 if (menu == 0) { | |
992 printf("No menus "); | |
993 } | |
994 if (menu & 0x80) { | |
995 printf("Root "); | |
996 menu^=0x80; | |
997 } | |
998 if (menu & 0x40) { | |
999 printf("Sub-Picture "); | |
1000 menu^=0x40; | |
1001 } | |
1002 if (menu & 0x20) { | |
1003 printf("Audio "); | |
1004 menu^=0x20; | |
1005 } | |
1006 if (menu & 0x10) { | |
1007 printf("Angle "); | |
1008 menu^=0x10; | |
1009 } | |
1010 if (menu & 0x08) { | |
1011 printf("PTT "); | |
1012 menu^=0x08; | |
1013 } | |
1014 if (menu > 0) { | |
1015 printf("Unknown extra menus "); | |
1016 menu^=0x08; | |
1017 } | |
1018 printf("\n"); | |
29 | 1019 ifoPrint_PGCIT(pgci_ut->lu[i].pgcit, 1); |
3 | 1020 } |
1021 } | |
1022 | |
1023 | |
29 | 1024 static void ifoPrint_VTS_ATTRIBUTES(vts_attributes_t *vts_attributes) { |
3 | 1025 int i; |
20 | 1026 |
3 | 1027 printf("VTS_CAT Application type: %08x\n", vts_attributes->vts_cat); |
20 | 1028 |
3 | 1029 printf("Video attributes of VTSM_VOBS: "); |
1030 ifo_print_video_attributes(5, &vts_attributes->vtsm_vobs_attr); | |
1031 printf("\n"); | |
20 | 1032 printf("Number of Audio streams: %i\n", |
26 | 1033 vts_attributes->nr_of_vtsm_audio_streams); |
3 | 1034 if(vts_attributes->nr_of_vtsm_audio_streams > 0) { |
1035 printf("\tstream %i attributes: ", 1); | |
1036 ifo_print_audio_attributes(5, &vts_attributes->vtsm_audio_attr); | |
1037 printf("\n"); | |
1038 } | |
20 | 1039 printf("Number of Subpicture streams: %i\n", |
26 | 1040 vts_attributes->nr_of_vtsm_subp_streams); |
3 | 1041 if(vts_attributes->nr_of_vtsm_subp_streams > 0) { |
1042 printf("\tstream %2i attributes: ", 1); | |
1043 ifo_print_subp_attributes(5, &vts_attributes->vtsm_subp_attr); | |
1044 printf("\n"); | |
1045 } | |
20 | 1046 |
3 | 1047 printf("Video attributes of VTSTT_VOBS: "); |
1048 ifo_print_video_attributes(5, &vts_attributes->vtstt_vobs_video_attr); | |
1049 printf("\n"); | |
20 | 1050 printf("Number of Audio streams: %i\n", |
26 | 1051 vts_attributes->nr_of_vtstt_audio_streams); |
3 | 1052 for(i = 0; i < vts_attributes->nr_of_vtstt_audio_streams; i++) { |
1053 printf("\tstream %i attributes: ", i); | |
1054 ifo_print_audio_attributes(5, &vts_attributes->vtstt_audio_attr[i]); | |
1055 printf("\n"); | |
1056 } | |
20 | 1057 |
1058 printf("Number of Subpicture streams: %i\n", | |
26 | 1059 vts_attributes->nr_of_vtstt_subp_streams); |
3 | 1060 for(i = 0; i < vts_attributes->nr_of_vtstt_subp_streams; i++) { |
20 | 1061 printf("\tstream %2i attributes: ", i); |
3 | 1062 ifo_print_subp_attributes(5, &vts_attributes->vtstt_subp_attr[i]); |
1063 printf("\n"); | |
1064 } | |
1065 } | |
1066 | |
1067 | |
60
aa36b2d85f8d
Mark a large number of functions not used outside of the file as static.
diego
parents:
35
diff
changeset
|
1068 static void ifoPrint_VTS_ATRT(vts_atrt_t *vts_atrt) { |
3 | 1069 int i; |
20 | 1070 |
3 | 1071 printf("Number of Video Title Sets: %3i\n", vts_atrt->nr_of_vtss); |
1072 for(i = 0; i < vts_atrt->nr_of_vtss; i++) { | |
1073 printf("\nVideo Title Set %i\n", i + 1); | |
29 | 1074 ifoPrint_VTS_ATTRIBUTES(&vts_atrt->vts[i]); |
3 | 1075 } |
1076 } | |
1077 | |
1078 | |
1079 void ifo_print(dvd_reader_t *dvd, int title) { | |
1080 ifo_handle_t *ifohandle; | |
1081 printf("Local ifo_print\n"); | |
1082 ifohandle = ifoOpen(dvd, title); | |
1083 if(!ifohandle) { | |
1084 fprintf(stderr, "Can't open info file for title %d\n", title); | |
1085 return; | |
1086 } | |
20 | 1087 |
1088 | |
3 | 1089 if(ifohandle->vmgi_mat) { |
1090 | |
1091 printf("VMG top level\n-------------\n"); | |
29 | 1092 ifoPrint_VMGI_MAT(ifohandle->vmgi_mat); |
3 | 1093 |
1094 printf("\nFirst Play PGC\n--------------\n"); | |
1095 if(ifohandle->first_play_pgc) | |
29 | 1096 ifoPrint_PGC(ifohandle->first_play_pgc); |
3 | 1097 else |
1098 printf("No First Play PGC present\n"); | |
1099 | |
1100 printf("\nTitle Track search pointer table\n"); | |
1101 printf( "------------------------------------------------\n"); | |
29 | 1102 ifoPrint_TT_SRPT(ifohandle->tt_srpt); |
3 | 1103 |
1104 printf("\nMenu PGCI Unit table\n"); | |
1105 printf( "--------------------\n"); | |
1106 if(ifohandle->pgci_ut) { | |
29 | 1107 ifoPrint_PGCI_UT(ifohandle->pgci_ut); |
3 | 1108 } else { |
1109 printf("No PGCI Unit table present\n"); | |
1110 } | |
1111 | |
35 | 1112 printf("\nParental Management Information table\n"); |
3 | 1113 printf( "------------------------------------\n"); |
1114 if(ifohandle->ptl_mait) { | |
29 | 1115 ifoPrint_PTL_MAIT(ifohandle->ptl_mait); |
3 | 1116 } else { |
1117 printf("No Parental Management Information present\n"); | |
1118 } | |
1119 | |
1120 printf("\nVideo Title Set Attribute Table\n"); | |
1121 printf( "-------------------------------\n"); | |
29 | 1122 ifoPrint_VTS_ATRT(ifohandle->vts_atrt); |
20 | 1123 |
3 | 1124 printf("\nText Data Manager Information\n"); |
1125 printf( "-----------------------------\n"); | |
1126 if(ifohandle->txtdt_mgi) { | |
1127 //ifo_print_TXTDT_MGI(&(vmgi->txtdt_mgi)); | |
1128 } else { | |
1129 printf("No Text Data Manager Information present\n"); | |
1130 } | |
1131 | |
35 | 1132 printf("\nMenu Cell Address table\n"); |
3 | 1133 printf( "-----------------\n"); |
1134 if(ifohandle->menu_c_adt) { | |
29 | 1135 ifoPrint_C_ADT(ifohandle->menu_c_adt); |
3 | 1136 } else { |
35 | 1137 printf("No Menu Cell Address table present\n"); |
3 | 1138 } |
1139 | |
1140 printf("\nVideo Manager Menu VOBU address map\n"); | |
1141 printf( "-----------------\n"); | |
1142 if(ifohandle->menu_vobu_admap) { | |
29 | 1143 ifoPrint_VOBU_ADMAP(ifohandle->menu_vobu_admap); |
3 | 1144 } else { |
20 | 1145 printf("No Menu VOBU address map present\n"); |
3 | 1146 } |
1147 } | |
1148 | |
1149 | |
1150 if(ifohandle->vtsi_mat) { | |
1151 | |
1152 printf("VTS top level\n-------------\n"); | |
29 | 1153 ifoPrint_VTSI_MAT(ifohandle->vtsi_mat); |
3 | 1154 |
1155 printf("\nPart of Title Track search pointer table\n"); | |
1156 printf( "----------------------------------------------\n"); | |
29 | 1157 ifoPrint_VTS_PTT_SRPT(ifohandle->vts_ptt_srpt); |
3 | 1158 |
1159 printf("\nPGCI Unit table\n"); | |
1160 printf( "--------------------\n"); | |
29 | 1161 ifoPrint_PGCIT(ifohandle->vts_pgcit, 0); |
3 | 1162 |
1163 printf("\nMenu PGCI Unit table\n"); | |
1164 printf( "--------------------\n"); | |
1165 if(ifohandle->pgci_ut) { | |
29 | 1166 ifoPrint_PGCI_UT(ifohandle->pgci_ut); |
3 | 1167 } else { |
1168 printf("No Menu PGCI Unit table present\n"); | |
1169 } | |
1170 | |
1171 printf("\nVTS Time Map table\n"); | |
1172 printf( "-----------------\n"); | |
1173 if(ifohandle->vts_tmapt) { | |
29 | 1174 ifoPrint_VTS_TMAPT(ifohandle->vts_tmapt); |
3 | 1175 } else { |
1176 printf("No VTS Time Map table present\n"); | |
1177 } | |
1178 | |
35 | 1179 printf("\nMenu Cell Address table\n"); |
3 | 1180 printf( "-----------------\n"); |
1181 if(ifohandle->menu_c_adt) { | |
29 | 1182 ifoPrint_C_ADT(ifohandle->menu_c_adt); |
3 | 1183 } else { |
35 | 1184 printf("No Cell Address table present\n"); |
3 | 1185 } |
1186 | |
1187 printf("\nVideo Title Set Menu VOBU address map\n"); | |
1188 printf( "-----------------\n"); | |
1189 if(ifohandle->menu_vobu_admap) { | |
29 | 1190 ifoPrint_VOBU_ADMAP(ifohandle->menu_vobu_admap); |
3 | 1191 } else { |
1192 printf("No Menu VOBU address map present\n"); | |
1193 } | |
1194 | |
1195 printf("\nCell Adress table\n"); | |
1196 printf( "-----------------\n"); | |
29 | 1197 ifoPrint_C_ADT(ifohandle->vts_c_adt); |
3 | 1198 |
1199 printf("\nVideo Title Set VOBU address map\n"); | |
1200 printf( "-----------------\n"); | |
29 | 1201 ifoPrint_VOBU_ADMAP(ifohandle->vts_vobu_admap); |
20 | 1202 } |
3 | 1203 |
1204 ifoClose(ifohandle); | |
1205 } |