unsigned int i_title;
unsigned int i_longest_title;
input_title_t **pp_title;
- unsigned int i_first_play;
- unsigned int i_top_menu;
/* Meta informations */
const META_DL *p_meta;
TAB_APPEND( p_sys->i_title, p_sys->pp_title, t );
bd_free_title_info(title_info);
}
-
- /* Create titles for BLURAY_TITLE_FIRST_PLAY & BLURAY_TITLE_TOP_MENU */
- input_title_t *p_first_play = vlc_input_title_New();
- if (unlikely(!p_first_play))
- return VLC_SUCCESS;
-
- p_first_play->psz_name = strdup("First play");
- p_sys->i_first_play = p_sys->i_title;
- TAB_APPEND(p_sys->i_title, p_sys->pp_title, p_first_play);
-
- input_title_t *p_top_menu = vlc_input_title_New();
- if (unlikely(!p_top_menu))
- return VLC_SUCCESS;
-
- p_top_menu->psz_name = strdup("Top menu");
- p_sys->i_top_menu = p_sys->i_title;
- TAB_APPEND(p_sys->i_title, p_sys->pp_title, p_top_menu);
return VLC_SUCCESS;
}
static void blurayUpdateTitle(demux_t *p_demux, unsigned i_title)
{
blurayResetParser(p_demux);
- if (i_title >= p_demux->p_sys->i_title) {
- if (i_title == BLURAY_TITLE_FIRST_PLAY)
- i_title = p_demux->p_sys->i_first_play;
- else if (i_title == BLURAY_TITLE_TOP_MENU)
- i_title = p_demux->p_sys->i_top_menu;
- else
- return;
- }
+ if (i_title >= p_demux->p_sys->i_title)
+ return;
/* read title info and init some values */
p_demux->info.i_title = i_title;
case DEMUX_GET_LENGTH:
{
int64_t *pi_length = (int64_t*)va_arg(args, int64_t *);
- *pi_length = CUR_LENGTH;
+ *pi_length = p_demux->info.i_title < p_sys->i_title ? CUR_LENGTH : 0;
return VLC_SUCCESS;
}
case DEMUX_SET_TIME:
case DEMUX_GET_POSITION:
{
double *pf_position = (double*)va_arg( args, double * );
- *pf_position = (double)FROM_TICKS(bd_tell_time(p_sys->bluray))/CUR_LENGTH;
+ *pf_position = p_demux->info.i_title < p_sys->i_title ?
+ (double)FROM_TICKS(bd_tell_time(p_sys->bluray))/CUR_LENGTH : 0.0;
return VLC_SUCCESS;
}
case DEMUX_SET_POSITION: