aboutsummaryrefslogtreecommitdiffhomepage
path: root/stream
diff options
context:
space:
mode:
authorGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-23 22:18:08 +0000
committerGravatar nicodvb <nicodvb@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-10-23 22:18:08 +0000
commitde0e99ce19f10b65d8e325aa2166d60f0484fe2a (patch)
tree2f5ead001aacc2e4fcc026a06b90b084a642959b /stream
parent83b70e340ba4cd0c2d1ff958c5b1cfdc96e67a9f (diff)
support for -chapter option (same semanthics as for dvd://)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@20425 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/stream_dvdnav.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/stream/stream_dvdnav.c b/stream/stream_dvdnav.c
index 96d1af1f2e..d6ea3e6c49 100644
--- a/stream/stream_dvdnav.c
+++ b/stream/stream_dvdnav.c
@@ -17,6 +17,8 @@
#include "help_mp.h"
extern char *dvd_device;
+extern int dvd_chapter;
+extern int dvd_last_chapter;
extern char *audio_lang, *dvdsub_lang;
static struct stream_priv_s {
@@ -223,6 +225,14 @@ static int fill_buffer(stream_t *s, char *but, int len)
}
break;
}
+ case DVDNAV_CELL_CHANGE: {
+ if(dvdnav_priv->title > 0 && dvd_last_chapter > 0) {
+ int tit=0, part=0;
+ if(dvdnav_current_title_info(dvdnav_priv->dvdnav, &tit, &part) == DVDNAV_STATUS_OK && part > dvd_last_chapter)
+ return 0;
+ }
+ }
+ break;
}
}
mp_msg(MSGT_STREAM,MSGL_DBG2,"DVDNAV fill_buffer len: %d\n",len);
@@ -293,11 +303,17 @@ 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_UNSUPORTED;
+ }
dvdnav_priv->title = p->track;
if(dvdnav_title_play(dvdnav_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(dvdnav_priv->dvdnav));
return STREAM_UNSUPORTED;
}
+ if(dvd_chapter > 0)
+ dvdnav_part_play(dvdnav_priv->dvdnav, p->track, dvd_chapter);
} else if(p->track == -1)
dvdnav_menu_call(dvdnav_priv->dvdnav, DVD_MENU_Root);
else {