summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stream/stream_bluray.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c
index 27ae5355a3..06d1e88b99 100644
--- a/stream/stream_bluray.c
+++ b/stream/stream_bluray.c
@@ -132,6 +132,27 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg)
return 1;
}
+ case STREAM_CTRL_GET_CHAPTER_TIME: {
+ BLURAY_TITLE_INFO *ti;
+ int chapter = *(double *)arg;
+ double time = MP_NOPTS_VALUE;
+
+ ti = bd_get_title_info(b->bd, b->current_title, b->current_angle);
+ if (!ti)
+ return STREAM_UNSUPPORTED;
+
+ if (chapter >= 0 || chapter < ti->chapter_count) {
+ time = BD_TIME_TO_MP(ti->chapters[chapter].start);
+ }
+ bd_free_title_info(ti);
+
+ if (time != MP_NOPTS_VALUE) {
+ *(double *)arg = time;
+ return STREAM_OK;
+ }
+ return STREAM_ERROR;
+ }
+
case STREAM_CTRL_GET_CURRENT_TITLE: {
*((unsigned int *) arg) = b->current_title;
return 1;