mirror of https://github.com/mpv-player/mpv
stream_bluray: report chapter times
This was forgotten in commit 7294303
.
This commit is contained in:
parent
c2657d5c98
commit
62786c0c91
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue