From e9b5773bf9a9e4af7873d3d44bbdf36f45275c66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Mon, 2 Dec 2024 22:26:49 +0100 Subject: [PATCH] stream_bluray: add STREAM_CTRL_GET_TITLE_PLAYLIST --- stream/stream.h | 3 ++- stream/stream_bluray.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/stream/stream.h b/stream/stream.h index d4c5d0fded..720db64c32 100644 --- a/stream/stream.h +++ b/stream/stream.h @@ -86,7 +86,8 @@ enum stream_ctrl { STREAM_CTRL_GET_ANGLE, STREAM_CTRL_SET_ANGLE, STREAM_CTRL_GET_NUM_TITLES, - STREAM_CTRL_GET_TITLE_LENGTH, // double* (in: title number, out: len) + STREAM_CTRL_GET_TITLE_LENGTH, // double* (in: title number, out: len) + STREAM_CTRL_GET_TITLE_PLAYLIST, // double* (in: title number, out: playlist) STREAM_CTRL_GET_LANG, STREAM_CTRL_GET_CURRENT_TITLE, STREAM_CTRL_SET_CURRENT_TITLE, diff --git a/stream/stream_bluray.c b/stream/stream_bluray.c index f1906d69c0..737f0e63ff 100644 --- a/stream/stream_bluray.c +++ b/stream/stream_bluray.c @@ -276,6 +276,16 @@ static int bluray_stream_control(stream_t *s, int cmd, void *arg) *(double *)arg = BD_TIME_TO_MP(ti->duration); return STREAM_OK; } + case STREAM_CTRL_GET_TITLE_PLAYLIST: { + int title = *(double *)arg; + if (!b->bd || title < 0 || title >= b->num_titles) + return STREAM_UNSUPPORTED; + const BLURAY_TITLE_INFO *ti = bd_get_title_info(b->bd, title, 0); + if (!ti) + return STREAM_UNSUPPORTED; + *(double *)arg = ti->playlist; + return STREAM_OK; + } case STREAM_CTRL_GET_LANG: { const BLURAY_TITLE_INFO *ti = b->title_info; if (ti && ti->clip_count) {