--- libdvdnav-4.1.3/src/dvdnav.c.orig 2009-01-10 15:55:00.000000000 -0800 +++ libdvdnav-4.1.3/src/dvdnav.c 2009-01-10 16:02:29.000000000 -0800 @@ -317,12 +317,12 @@ * Should really assert if bit 31 != 1 */ -#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 */ @@ -726,7 +726,12 @@ 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);