From 62786c0c91304aab720cf52674868c52a5b76f72 Mon Sep 17 00:00:00 2001 From: wm4 Date: Thu, 9 May 2013 18:49:16 +0200 Subject: stream_bluray: report chapter times This was forgotten in commit 7294303. --- stream/stream_bluray.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'stream/stream_bluray.c') 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; -- cgit v1.2.3