From f785eba8a1af1345bd757e00ab419c8b0120f5ea Mon Sep 17 00:00:00 2001 From: nicodvb Date: Mon, 11 Feb 2008 22:03:34 +0000 Subject: -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 --- mencoder.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index 7fa12f5efe..f6a0783605 100644 --- a/mencoder.c +++ b/mencoder.c @@ -603,6 +603,11 @@ if(stream->type==STREAMTYPE_DVDNAV){ mp_msg(MSGT_DEMUXER, MSGL_FATAL, MSGTR_CannotOpenDemuxer); mencoder_exit(1,NULL); } + + if(dvd_chapter>1) { + float pts; + demuxer_seek_chapter(demuxer, dvd_chapter-1, 1, &pts, NULL, NULL); + } d_audio=demuxer2 ? demuxer2->audio : demuxer->audio; d_video=demuxer->video; @@ -1098,6 +1103,11 @@ while(!at_eof){ --play_n_frames; if(play_n_frames<0) break; } + if(dvd_last_chapter>0) { + int cur_chapter = demuxer_get_current_chapter(demuxer); + if(cur_chapter!=-1 && cur_chapter+1>dvd_last_chapter) + break; + } goto_redo_edl: if (next_edl_record && sh_video && sh_video->pts >= next_edl_record->start_sec) { -- cgit v1.2.3