summaryrefslogtreecommitdiffstats
path: root/stream/stream_dvd.c
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-12-13 20:25:31 +0100
committerwm4 <wm4@nowhere>2014-12-13 20:25:56 +0100
commit5b618ef62976370ca184839d0bd8efd615e9f20e (patch)
tree8be94ca30d18ff40e86fe1b6f4f216cc81078e10 /stream/stream_dvd.c
parentc3275f7e531dc95f68e7a293d1e75684d75725f2 (diff)
downloadmpv-5b618ef62976370ca184839d0bd8efd615e9f20e.tar.bz2
mpv-5b618ef62976370ca184839d0bd8efd615e9f20e.tar.xz
command, dvd: add property which returns list of DVD titles
This was requested. It seems libdvdread can't get the duration for titlesets other than the currently opened title. The data structures contain dangling pointers for these, and MPlayer works this around by opening every title separately for the purpose of dumping the title list.
Diffstat (limited to 'stream/stream_dvd.c')
-rw-r--r--stream/stream_dvd.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/stream/stream_dvd.c b/stream/stream_dvd.c
index 5ec1e522bd..5be70b2d1d 100644
--- a/stream/stream_dvd.c
+++ b/stream/stream_dvd.c
@@ -541,6 +541,18 @@ static int control(stream_t *stream,int cmd,void* arg)
*((unsigned int *)arg) = d->vmg_file->tt_srpt->nr_of_srpts;
return 1;
}
+ case STREAM_CTRL_GET_TITLE_LENGTH:
+ {
+ int t = *(double *)arg;
+ if (t < 0 || t >= d->vmg_file->tt_srpt->nr_of_srpts)
+ break;
+ if (d->tt_srpt->title[t].title_set_nr !=
+ d->tt_srpt->title[d->dvd_title].title_set_nr)
+ break;
+ *(double *)arg =
+ mp_get_titleset_length(d->vts_file, d->tt_srpt, t) / 1000.0;
+ return 1;
+ }
case STREAM_CTRL_GET_NUM_CHAPTERS:
{
int r;