1
mirror of https://code.videolan.org/videolan/vlc synced 2024-08-27 04:21:53 +02:00

vlc input control: add INPUT_GET_TITLE_INFO

as we'll need seekpoints for UI: chapters offsets were not sufficient.
This commit is contained in:
Francois Cartegnie 2011-06-25 16:57:06 +02:00
parent 8b85c01718
commit f90323146e
3 changed files with 29 additions and 0 deletions

View File

@ -494,6 +494,9 @@ enum input_query_e
INPUT_DEL_BOOKMARK, /* arg1= seekpoint_t * res=can fail */
INPUT_SET_BOOKMARK, /* arg1= int res=can fail */
/* titles */
INPUT_GET_TITLE_INFO, /* arg1=input_title_t** arg2= int * res=can fail */
/* Attachments */
INPUT_GET_ATTACHMENTS, /* arg1=input_attachment_t***, arg2=int* res=can fail */
INPUT_GET_ATTACHMENT, /* arg1=input_attachment_t**, arg2=char* res=can fail */

View File

@ -325,6 +325,30 @@ int input_vaControl( input_thread_t *p_input, int i_query, va_list args )
vlc_mutex_unlock( &p_input->p->p_item->lock );
return VLC_SUCCESS;
case INPUT_GET_TITLE_INFO:
{
input_title_t **p_title = (input_title_t **)va_arg( args, input_title_t ** );
int *pi_req_title_offset = (int *) va_arg( args, int * );
vlc_mutex_lock( &p_input->p->p_item->lock );
/* current title if -1 */
if ( *pi_req_title_offset < 0 )
*pi_req_title_offset = p_input->p->i_title_offset;
if( p_input->p->i_title && p_input->p->i_title > *pi_req_title_offset )
{
*p_title = vlc_input_title_Duplicate( p_input->p->title[*pi_req_title_offset] );
vlc_mutex_unlock( &p_input->p->p_item->lock );
return VLC_SUCCESS;
}
else
{
vlc_mutex_unlock( &p_input->p->p_item->lock );
return VLC_EGENERIC;
}
}
case INPUT_ADD_OPTION:
{
const char *psz_option = va_arg( args, const char * );

View File

@ -935,6 +935,7 @@ static void InitTitle( input_thread_t * p_input )
if( p_input->b_preparsing )
return;
vlc_mutex_lock( &p_input->p->p_item->lock );
/* Create global title (from master) */
p_input->p->i_title = p_master->i_title;
p_input->p->title = p_master->title;
@ -951,6 +952,7 @@ static void InitTitle( input_thread_t * p_input )
p_input->p->b_can_pace_control = p_master->b_can_pace_control;
p_input->p->b_can_pause = p_master->b_can_pause;
p_input->p->b_can_rate_control = p_master->b_can_rate_control;
vlc_mutex_unlock( &p_input->p->p_item->lock );
}
static void StartTitle( input_thread_t * p_input )