diff -ru libdvdnav-0.1.10/src/dvdnav.c libdvdnav-0.1.10-don/src/dvdnav.c --- libdvdnav-0.1.10/src/dvdnav.c 2004-01-31 09:12:58.000000000 -0800 +++ libdvdnav-0.1.10-don/src/dvdnav.c 2005-12-12 21:42:54.000000000 -0800 @@ -315,13 +315,14 @@ * DVDs are about 6 Gigs, which is only up to 0x300000 blocks * Should really assert if bit 31 != 1 */ +#define TRUST_IFO -#if 0 +#ifdef TRUST_IFO /* Old code -- may still be useful one day */ if(nav_dsi->vobu_sri.next_vobu != SRI_END_OF_CELL ) { vobu->vobu_next = ( nav_dsi->vobu_sri.next_vobu & 0x3fffffff ); } else { - vobu->vobu_next = vobu->vobu_length; + vobu->vobu_next = vobu->vobu_length + 1; } #else /* Relative offset from vobu_start */ @@ -711,9 +716,14 @@ /* Have we reached the end of a VOBU? */ if (this->vobu.blockN >= this->vobu.vobu_length) { /* Have we reached the end of a cell? */ +#ifdef TRUST_IFO + if((this->vobu.vobu_start + this->vobu.vobu_length) >= state->pgc->cell_playback[state->cellN-1].last_sector) { + this->vobu.vobu_next = SRI_END_OF_CELL; +#else if(this->vobu.vobu_next == SRI_END_OF_CELL) { +#endif /* End of Cell from NAV DSI info */ #ifdef LOG_DEBUG fprintf(MSG_OUT, "libdvdnav: Still set to %x\n", this->position_next.still);