summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authornicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-11 22:03:34 +0000
committernicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-02-11 22:03:34 +0000
commitf785eba8a1af1345bd757e00ab419c8b0120f5ea (patch)
tree8f5cdfe5fb3566ee8bee093064287be0ea47db0c /stream
parentd31f87b06cda035677139b262ef260c9fac31bed (diff)
downloadmpv-f785eba8a1af1345bd757e00ab419c8b0120f5ea.tar.bz2
mpv-f785eba8a1af1345bd757e00ab419c8b0120f5ea.tar.xz
-chapter is now handled uniformly calling demuxer_seek_chapter() instead
of letting individual demuxers and stream readers do their nasty job git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@25987 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvd.c25
-rw-r--r--stream/stream_dvdnav.c6
2 files changed, 2 insertions, 29 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 1ec2efc24a..c5a22d8089 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -883,22 +883,6 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
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 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
* 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 )
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index 4ee9eef40a..633ff65b45 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -558,17 +558,11 @@ static int open_s(stream_t *stream,int mode, void* opts, int* file_format) {
}
if(p->track > 0) {
- if(dvd_chapter > 0 && dvd_last_chapter > 0 && dvd_chapter > dvd_last_chapter) {
- mp_msg(MSGT_OPEN,MSGL_FATAL,"dvdnav_stream, invalid chapter range: %d > %d\n", dvd_chapter, dvd_last_chapter);
- return STREAM_UNSUPPORTED;
- }
priv->title = p->track;
if(dvdnav_title_play(priv->dvdnav, p->track) != DVDNAV_STATUS_OK) {
mp_msg(MSGT_OPEN,MSGL_FATAL,"dvdnav_stream, couldn't select title %d, error '%s'\n", p->track, dvdnav_err_to_string(priv->dvdnav));
return STREAM_UNSUPPORTED;
}
- if(dvd_chapter > 0)
- dvdnav_part_play(priv->dvdnav, p->track, dvd_chapter);
} else if (p->track == 0) {
if(dvdnav_menu_call(priv->dvdnav, DVD_MENU_Root) != DVDNAV_STATUS_OK)
dvdnav_menu_call(priv->dvdnav, DVD_MENU_Title);