summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
authorib <ib@b3059339-0415-0410-9bf9-f77b7e298cf2>2012-10-21 14:56:50 +0000
committerwm4 <wm4@nowhere>2012-10-30 19:50:20 +0100
commit1215f0871cd7aa4e5aaca85fe86acffa6da0463e (patch)
treef8adcc3bea7df6f4eaf92d6096bea65036b29b8a /stream
parentd509a7867bc885cfcab738b142e6ec1812bb47fc (diff)
downloadmpv-1215f0871cd7aa4e5aaca85fe86acffa6da0463e.tar.bz2
mpv-1215f0871cd7aa4e5aaca85fe86acffa6da0463e.tar.xz
stream: add STREAM_CTRL_GET_CURRENT_TITLE
Add new stream control command STREAM_CTRL_GET_CURRENT_TITLE for DVDs. This provides the current title (aka track) number of a DVD. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@35263 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'stream')
-rw-r--r--stream/cache2.c3
-rw-r--r--stream/stream.h1
-rw-r--r--stream/stream_bluray.c5
-rw-r--r--stream/stream_dvd.c5
4 files changed, 14 insertions, 0 deletions
diff --git a/stream/cache2.c b/stream/cache2.c
index de7465a0dc..d9c4fbb09d 100644
--- a/stream/cache2.c
+++ b/stream/cache2.c
@@ -307,6 +307,7 @@ static int cache_execute_control(cache_vars_t *s) {
uint_res = s->control_uint_arg;
case STREAM_CTRL_GET_NUM_TITLES:
case STREAM_CTRL_GET_NUM_CHAPTERS:
+ case STREAM_CTRL_GET_CURRENT_TITLE:
case STREAM_CTRL_GET_CURRENT_CHAPTER:
case STREAM_CTRL_GET_NUM_ANGLES:
case STREAM_CTRL_GET_ANGLE:
@@ -634,6 +635,7 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) {
s->control_lang_arg = *(struct stream_lang_req *)arg;
case STREAM_CTRL_GET_NUM_TITLES:
case STREAM_CTRL_GET_NUM_CHAPTERS:
+ case STREAM_CTRL_GET_CURRENT_TITLE:
case STREAM_CTRL_GET_CURRENT_CHAPTER:
case STREAM_CTRL_GET_ASPECT_RATIO:
case STREAM_CTRL_GET_NUM_ANGLES:
@@ -674,6 +676,7 @@ int cache_do_control(stream_t *stream, int cmd, void *arg) {
break;
case STREAM_CTRL_GET_NUM_TITLES:
case STREAM_CTRL_GET_NUM_CHAPTERS:
+ case STREAM_CTRL_GET_CURRENT_TITLE:
case STREAM_CTRL_GET_CURRENT_CHAPTER:
case STREAM_CTRL_GET_NUM_ANGLES:
case STREAM_CTRL_GET_ANGLE:
diff --git a/stream/stream.h b/stream/stream.h
index 0cee8498eb..9416e42ca8 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -95,6 +95,7 @@
#define STREAM_CTRL_SET_ANGLE 11
#define STREAM_CTRL_GET_NUM_TITLES 12
#define STREAM_CTRL_GET_LANG 13
+#define STREAM_CTRL_GET_CURRENT_TITLE 14
struct stream_lang_req {
int type; // STREAM_AUDIO, STREAM_SUB
diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c
index ffe0200019..a126661e30 100644
--- a/stream/stream_bluray.c
+++ b/stream/stream_bluray.c
@@ -127,6 +127,11 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg)
return 1;
}
+ case STREAM_CTRL_GET_CURRENT_TITLE: {
+ *((unsigned int *) arg) = b->current_title;
+ return 1;
+ }
+
case STREAM_CTRL_GET_CURRENT_CHAPTER: {
*((unsigned int *) arg) = b->current_chapter;
return 1;
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 05492ce490..689e773c9d 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -643,6 +643,11 @@ static int control(stream_t *stream,int cmd,void* arg)
return 1;
}
+ case STREAM_CTRL_GET_CURRENT_TITLE:
+ {
+ *((unsigned int *)arg) = d->cur_title - 1;
+ return 1;
+ }
case STREAM_CTRL_GET_CURRENT_CHAPTER:
{
*((unsigned int *)arg) = dvd_chapter_from_cell(d, d->cur_title-1, d->cur_cell);