diff stream/stream_dvd.c @ 25955:eff9e1b25743

-chapter is now handled uniformly calling demuxer_seek_chapter() instead of letting individual demuxers and stream readers do their nasty job
author nicodvb
date Mon, 11 Feb 2008 22:03:34 +0000
parents 68015115f63a
children 77003eb2d9a8
line wrap: on
line diff
--- a/stream/stream_dvd.c	Mon Feb 11 21:24:21 2008 +0000
+++ b/stream/stream_dvd.c	Mon Feb 11 22:03:34 2008 +0000
@@ -883,22 +883,6 @@
     mp_msg(MSGT_IDENTIFY, MSGL_INFO, "ID_DVD_CURRENT_TITLE=%d\n", dvd_title);
     --dvd_title; // remap 1.. -> 0..
     /**
-     * Make sure the chapter number is valid for this title.
-     */
-    mp_msg(MSGT_OPEN,MSGL_STATUS, MSGTR_DVDnumChapters, tt_srpt->title[dvd_title].nr_of_ptts);
-    if(dvd_chapter<1 || dvd_chapter>tt_srpt->title[dvd_title].nr_of_ptts) {
-      mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidChapter, dvd_chapter);
-      goto fail;
-    }
-    if(dvd_last_chapter>0) {
-      if(dvd_last_chapter<dvd_chapter || dvd_last_chapter>tt_srpt->title[dvd_title].nr_of_ptts) {
-        mp_msg(MSGT_OPEN,MSGL_ERR, MSGTR_DVDinvalidLastChapter, dvd_last_chapter);
-        goto fail;
-      }
-    }
-    --dvd_chapter; // remap 1.. -> 0..
-    /* XXX No need to remap dvd_last_chapter */
-    /**
      * Make sure the angle number is valid for this title.
      */
     mp_msg(MSGT_OPEN,MSGL_STATUS, MSGTR_DVDnumAngles, tt_srpt->title[dvd_title].nr_of_angles);
@@ -1041,18 +1025,13 @@
      * Determine which program chain we want to watch.  This is based on the
      * chapter number.
      */
-    pgc_id = vts_file->vts_ptt_srpt->title[ttn].ptt[dvd_chapter].pgcn; // local
-    pgn  = vts_file->vts_ptt_srpt->title[ttn].ptt[dvd_chapter].pgn;  // local
+    pgc_id = vts_file->vts_ptt_srpt->title[ttn].ptt[0].pgcn; // local
+    pgn  = vts_file->vts_ptt_srpt->title[ttn].ptt[0].pgn;  // local
     d->cur_pgc_idx = pgc_id-1;
     d->cur_pgc = vts_file->vts_pgcit->pgci_srp[pgc_id-1].pgc;
     d->cur_cell = d->cur_pgc->program_map[pgn-1] - 1; // start playback here
     d->packs_left=-1;      // for Navi stuff
     d->angle_seek=0;
-    /* XXX dvd_last_chapter is in the range 1..nr_of_ptts */
-    if(dvd_last_chapter > 0 && dvd_last_chapter < tt_srpt->title[dvd_title].nr_of_ptts) {
-      pgn=vts_file->vts_ptt_srpt->title[ttn].ptt[dvd_last_chapter].pgn;
-      d->last_cell=d->cur_pgc->program_map[pgn-1] - 1;
-    } else
       d->last_cell=d->cur_pgc->nr_of_cells;
 
     if(d->cur_pgc->cell_playback[d->cur_cell].block_type == BLOCK_TYPE_ANGLE_BLOCK )