summaryrefslogtreecommitdiffstats
path: root/stream
diff options
context:
space:
mode:
Diffstat (limited to 'stream')
-rw-r--r--stream/stream.h1
-rw-r--r--stream/stream_cdda.c5
-rw-r--r--stream/stream_dvd.c5
-rw-r--r--stream/stream_vcd.c1
4 files changed, 12 insertions, 0 deletions
diff --git a/stream/stream.h b/stream/stream.h
index 81bfcf0386..3ad65bb656 100644
--- a/stream/stream.h
+++ b/stream/stream.h
@@ -98,6 +98,7 @@
#define STREAM_CTRL_GET_NUM_ANGLES 9
#define STREAM_CTRL_GET_ANGLE 10
#define STREAM_CTRL_SET_ANGLE 11
+#define STREAM_CTRL_GET_NUM_TITLES 12
typedef enum {
diff --git a/stream/stream_cdda.c b/stream/stream_cdda.c
index 8bd179b1df..a014ad14c4 100644
--- a/stream/stream_cdda.c
+++ b/stream/stream_cdda.c
@@ -254,6 +254,11 @@ static int control(stream_t *stream, int cmd, void *arg)
{
cdda_priv *p = stream->priv;
switch (cmd) {
+ case STREAM_CTRL_GET_NUM_TITLES:
+ {
+ *(unsigned int *)arg = p->cd->tracks;
+ return STREAM_OK;
+ }
case STREAM_CTRL_GET_NUM_CHAPTERS:
{
int start_track = get_track_by_sector(p, p->start_sector);
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 2121e78ccc..b9ffafed8f 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -621,6 +621,11 @@ static int control(stream_t *stream,int cmd,void* arg)
*((double *)arg) = (double) mp_get_titleset_length(d->vts_file, d->tt_srpt, d->cur_title-1)/1000.0;
return 1;
}
+ case STREAM_CTRL_GET_NUM_TITLES:
+ {
+ *((unsigned int *)arg) = d->vmg_file->tt_srpt->nr_of_srpts;
+ return 1;
+ }
case STREAM_CTRL_GET_NUM_CHAPTERS:
{
int r;
diff --git a/stream/stream_vcd.c b/stream/stream_vcd.c
index e06e381f59..0dae3731fb 100644
--- a/stream/stream_vcd.c
+++ b/stream/stream_vcd.c
@@ -91,6 +91,7 @@ static int seek(stream_t *s,off_t newpos) {
static int control(stream_t *stream, int cmd, void *arg) {
struct stream_priv_s *p = stream->priv;
switch(cmd) {
+ case STREAM_CTRL_GET_NUM_TITLES:
case STREAM_CTRL_GET_NUM_CHAPTERS:
{
mp_vcd_priv_t *vcd = vcd_read_toc(stream->fd);