Mercurial > libdvdnav.hg
diff ifo_read.c @ 183:b0aa6f7931c0 src
merging patch from xine-lib's libdvdread
* this mostly aligns all data blocks in memory to make raw device reads work
* some MSVC related patches that went into xine-lib cvs are also included
author | mroi |
---|---|
date | Tue, 29 Apr 2003 15:14:00 +0000 |
parents | 330ef38ad968 |
children |
line wrap: on
line diff
--- a/ifo_read.c Tue Apr 29 14:49:15 2003 +0000 +++ b/ifo_read.c Tue Apr 29 15:14:00 2003 +0000 @@ -659,7 +659,7 @@ /* Check that time is 0:0:0:0 also if nr_of_programs == 0 */ if(pgc->nr_of_programs == 0) { CHECK_ZERO(pgc->still_time); - CHECK_ZERO(pgc->pg_playback_mode); // ?? + CHECK_ZERO(pgc->pg_playback_mode); /* ?? */ CHECK_VALUE(pgc->program_map_offset == 0); CHECK_VALUE(pgc->cell_playback_offset == 0); CHECK_VALUE(pgc->cell_position_offset == 0); @@ -844,24 +844,24 @@ CHECK_ZERO(tt_srpt->zero_1); CHECK_VALUE(tt_srpt->nr_of_srpts != 0); - CHECK_VALUE(tt_srpt->nr_of_srpts < 100); // ?? + CHECK_VALUE(tt_srpt->nr_of_srpts < 100); /* ?? */ CHECK_VALUE((int)tt_srpt->nr_of_srpts * sizeof(title_info_t) <= info_length); for(i = 0; i < tt_srpt->nr_of_srpts; i++) { CHECK_VALUE(tt_srpt->title[i].pb_ty.zero_1 == 0); CHECK_VALUE(tt_srpt->title[i].nr_of_angles != 0); CHECK_VALUE(tt_srpt->title[i].nr_of_angles < 10); - //CHECK_VALUE(tt_srpt->title[i].nr_of_ptts != 0); - // XXX: this assertion breaks Ghostbusters: - CHECK_VALUE(tt_srpt->title[i].nr_of_ptts < 1000); // ?? + /* CHECK_VALUE(tt_srpt->title[i].nr_of_ptts != 0); */ + /* XXX: this assertion breaks Ghostbusters: */ + CHECK_VALUE(tt_srpt->title[i].nr_of_ptts < 1000); /* ?? */ CHECK_VALUE(tt_srpt->title[i].title_set_nr != 0); - CHECK_VALUE(tt_srpt->title[i].title_set_nr < 100); // ?? + CHECK_VALUE(tt_srpt->title[i].title_set_nr < 100); /* ?? */ CHECK_VALUE(tt_srpt->title[i].vts_ttn != 0); - CHECK_VALUE(tt_srpt->title[i].vts_ttn < 100); // ?? - //CHECK_VALUE(tt_srpt->title[i].title_set_sector != 0); + CHECK_VALUE(tt_srpt->title[i].vts_ttn < 100); /* ?? */ + /* CHECK_VALUE(tt_srpt->title[i].title_set_sector != 0); */ } - // Make this a function + /* Make this a function */ #if 0 if(memcmp((uint8_t *)tt_srpt->title + tt_srpt->nr_of_srpts * sizeof(title_info_t), @@ -925,7 +925,7 @@ CHECK_ZERO(vts_ptt_srpt->zero_1); CHECK_VALUE(vts_ptt_srpt->nr_of_srpts != 0); - CHECK_VALUE(vts_ptt_srpt->nr_of_srpts < 100); // ?? + CHECK_VALUE(vts_ptt_srpt->nr_of_srpts < 100); /* ?? */ info_length = vts_ptt_srpt->last_byte + 1 - VTS_PTT_SRPT_SIZE; @@ -1001,12 +1001,12 @@ } for(i = 0; i < vts_ptt_srpt->nr_of_srpts; i++) { - CHECK_VALUE(vts_ptt_srpt->title[i].nr_of_ptts < 1000); // ?? + CHECK_VALUE(vts_ptt_srpt->title[i].nr_of_ptts < 1000); /* ?? */ for(j = 0; j < vts_ptt_srpt->title[i].nr_of_ptts; j++) { CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgcn != 0 ); - CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgcn < 1000); // ?? + CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgcn < 1000); /* ?? */ CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgn != 0); - CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgn < 100); // ?? + CHECK_VALUE(vts_ptt_srpt->title[i].ptt[j].pgn < 100); /* ?? */ } } @@ -1064,9 +1064,9 @@ B2N_32(ptl_mait->last_byte); CHECK_VALUE(ptl_mait->nr_of_countries != 0); - CHECK_VALUE(ptl_mait->nr_of_countries < 100); // ?? + CHECK_VALUE(ptl_mait->nr_of_countries < 100); /* ?? */ CHECK_VALUE(ptl_mait->nr_of_vtss != 0); - CHECK_VALUE(ptl_mait->nr_of_vtss < 100); // ?? + CHECK_VALUE(ptl_mait->nr_of_vtss < 100); /* ?? */ CHECK_VALUE(ptl_mait->nr_of_countries * PTL_MAIT_COUNTRY_SIZE <= ptl_mait->last_byte + 1 - PTL_MAIT_SIZE); @@ -1605,7 +1605,7 @@ /* assert(pgcit->nr_of_pgci_srp != 0); Magic Knight Rayearth Daybreak is mastered very strange and has Titles with 0 PTTs. */ - CHECK_VALUE(pgcit->nr_of_pgci_srp < 10000); // ?? seen max of 1338 + CHECK_VALUE(pgcit->nr_of_pgci_srp < 10000); /* ?? seen max of 1338 */ info_length = pgcit->nr_of_pgci_srp * PGCI_SRP_SIZE; data = malloc(info_length); @@ -1726,7 +1726,7 @@ CHECK_ZERO(pgci_ut->zero_1); CHECK_VALUE(pgci_ut->nr_of_lus != 0); - CHECK_VALUE(pgci_ut->nr_of_lus < 100); // ?? 3-4 ? + CHECK_VALUE(pgci_ut->nr_of_lus < 100); /* ?? 3-4 ? */ CHECK_VALUE((uint32_t)pgci_ut->nr_of_lus * PGCI_LU_SIZE < pgci_ut->last_byte); info_length = pgci_ut->nr_of_lus * PGCI_LU_SIZE; @@ -1760,7 +1760,7 @@ free(data); for(i = 0; i < pgci_ut->nr_of_lus; i++) { - // Maybe this is only defined for v1.1 and later titles? + /* Maybe this is only defined for v1.1 and later titles? */ /* If the bits in 'lu[i].exists' are enumerated abcd efgh then: VTS_x_yy.IFO VIDEO_TS.IFO a == 0x83 "Root" 0x82 "Title" @@ -1799,8 +1799,10 @@ ifofile->pgci_ut = 0; return 0; } - // FIXME: Iterate and verify that all menus that should exists accordingly - // to pgci_ut->lu[i].exists really do? + /* + * FIXME: Iterate and verify that all menus that should exists accordingly + * to pgci_ut->lu[i].exists really do? + */ } return 1; @@ -1861,8 +1863,8 @@ unsigned int nr_coded; CHECK_VALUE(vts_attributes->last_byte + 1 >= VTS_ATTRIBUTES_MIN_SIZE); nr_coded = (vts_attributes->last_byte + 1 - VTS_ATTRIBUTES_MIN_SIZE)/6; - // This is often nr_coded = 70, how do you know how many there really are? - if(nr_coded > 32) { // We haven't read more from disk/file anyway + /* This is often nr_coded = 70, how do you know how many there really are? */ + if(nr_coded > 32) { /* We haven't read more from disk/file anyway */ nr_coded = 32; } CHECK_VALUE(vts_attributes->nr_of_vtstt_subp_streams <= nr_coded); @@ -1910,7 +1912,7 @@ CHECK_ZERO(vts_atrt->zero_1); CHECK_VALUE(vts_atrt->nr_of_vtss != 0); - CHECK_VALUE(vts_atrt->nr_of_vtss < 100); //?? + CHECK_VALUE(vts_atrt->nr_of_vtss < 100); /* ?? */ CHECK_VALUE((uint32_t)vts_atrt->nr_of_vtss * (4 + VTS_ATTRIBUTES_MIN_SIZE) + VTS_ATRT_SIZE < vts_atrt->last_byte + 1); @@ -1954,9 +1956,9 @@ return 0; } - // This assert cant be in ifoRead_VTS_ATTRIBUTES + /* This assert cant be in ifoRead_VTS_ATTRIBUTES */ CHECK_VALUE(offset + vts_atrt->vts[i].last_byte <= vts_atrt->last_byte + 1); - // Is this check correct? + /* Is this check correct? */ } return 1; @@ -2006,7 +2008,7 @@ return 0; } - // fprintf(stderr, "-- Not done yet --\n"); + /* fprintf(stderr, "-- Not done yet --\n"); */ return 1; }