diff options
author | wm4 <wm4@nowhere> | 2013-05-09 18:49:16 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-05-09 18:49:16 +0200 |
commit | 62786c0c91304aab720cf52674868c52a5b76f72 (patch) | |
tree | c68355257062216b00105825e514e9a9fe7dc765 | |
parent | c2657d5c9850b259ed13746ed099e3b9ddd0084b (diff) | |
download | mpv-62786c0c91304aab720cf52674868c52a5b76f72.tar.bz2 mpv-62786c0c91304aab720cf52674868c52a5b76f72.tar.xz |
stream_bluray: report chapter times
This was forgotten in commit 7294303.
-rw-r--r-- | stream/stream_bluray.c | 21 |
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; |