]> git.sesse.net Git - vlc/commitdiff
* modules/access/dvdread.c: fixed chapter change detection.
authorGildas Bazin <gbazin@videolan.org>
Sun, 22 Aug 2004 11:06:28 +0000 (11:06 +0000)
committerGildas Bazin <gbazin@videolan.org>
Sun, 22 Aug 2004 11:06:28 +0000 (11:06 +0000)
modules/access/dvdread.c

index a72f32da676548146321f70e7db919254f2640b7..297701164ada56b9418df97b882c4e23eef87324 100644 (file)
@@ -1194,13 +1194,15 @@ static void DvdReadFindCell( demux_t *p_demux )
 
 #undef cell
 
+    if( p_sys->i_chapter + 1 >= p_sys->i_chapters ) return;
+
     pgc_id = p_sys->p_vts_file->vts_ptt_srpt->title[
-                p_sys->i_ttn - 1].ptt[p_sys->i_chapter].pgcn;
+                p_sys->i_ttn - 1].ptt[p_sys->i_chapter + 1].pgcn;
     pgn = p_sys->p_vts_file->vts_ptt_srpt->title[
-              p_sys->i_ttn - 1].ptt[p_sys->i_chapter].pgn;
+              p_sys->i_ttn - 1].ptt[p_sys->i_chapter + 1].pgn;
     p_pgc = p_sys->p_vts_file->vts_pgcit->pgci_srp[pgc_id - 1].pgc;
 
-    if( p_pgc->program_map[pgn - 1] <= p_sys->i_cur_cell )
+    if( p_sys->i_cur_cell >= p_pgc->program_map[pgn - 1] - 1 )
     {
         p_sys->i_chapter++;