Commit e1a9f330 authored by Petri Hintukainen's avatar Petri Hintukainen Committed by Jean-Baptiste Kempf

bluray: use bd_get_main_title()

Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent e4dabd8c
......@@ -1138,13 +1138,19 @@ static void blurayUpdateTitleInfo(demux_t *p_demux, input_title_t *t, int i_titl
static void blurayInitTitles(demux_t *p_demux, int menu_titles)
{
demux_sys_t *p_sys = p_demux->p_sys;
#if BLURAY_VERSION < BLURAY_VERSION_CODE(0,5,0)
int64_t duration = 0;
#endif
/* get and set the titles */
unsigned i_title = menu_titles;
if (!p_sys->b_menu)
if (!p_sys->b_menu) {
i_title = bd_get_titles(p_sys->bluray, TITLES_RELEVANT, 60);
#if BLURAY_VERSION >= BLURAY_VERSION_CODE(0,5,0)
p_sys->i_longest_title = bd_get_main_title(p_sys->bluray);
#endif
}
for (unsigned int i = 0; i < i_title; i++) {
input_title_t *t = vlc_input_title_New();
......@@ -1154,10 +1160,12 @@ static void blurayInitTitles(demux_t *p_demux, int menu_titles)
if (!p_sys->b_menu) {
blurayUpdateTitleInfo(p_demux, t, i, -1);
#if BLURAY_VERSION < BLURAY_VERSION_CODE(0,5,0)
if (t->i_length > duration) {
duration = t->i_length;
p_sys->i_longest_title = i;
}
#endif
} else if (i == 0) {
t->psz_name = strdup(_("Top Menu"));
} else if (i == i_title - 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment