Commit c2ae62db authored by Denis Charmet's avatar Denis Charmet Committed by Jean-Baptiste Kempf

Allow the demux to update its title list

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 7697d8b2
......@@ -245,6 +245,7 @@ static inline void vlc_input_attachment_Delete( input_attachment_t *a )
#define INPUT_UPDATE_SEEKPOINT 0x0020
#define INPUT_UPDATE_META 0x0040
#define INPUT_UPDATE_SIGNAL 0x0080
#define INPUT_UPDATE_TITLE_LIST 0x0100
/**
* This defines private core storage for an input.
......
......@@ -82,6 +82,7 @@ static void UpdateGenericFromAccess( input_thread_t * );
static int UpdateTitleSeekpointFromDemux( input_thread_t * );
static void UpdateGenericFromDemux( input_thread_t * );
static void UpdateTitleListfromDemux( input_thread_t * );
static void MRLSections( const char *, int *, int *, int *, int *);
......@@ -584,6 +585,11 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, bool *pb_d
{
if( p_input->p->input.p_demux->info.i_update )
{
if( p_input->p->input.p_demux->info.i_update & INPUT_UPDATE_TITLE_LIST )
{
UpdateTitleListfromDemux( p_input );
p_input->p->input.p_demux->info.i_update &= ~INPUT_UPDATE_TITLE_LIST;
}
if( p_input->p->input.b_title_demux )
{
i_ret = UpdateTitleSeekpointFromDemux( p_input );
......@@ -2267,6 +2273,30 @@ static void UpdateGenericFromDemux( input_thread_t *p_input )
p_demux->info.i_update &= ~INPUT_UPDATE_SIZE;
}
static void UpdateTitleListfromDemux( input_thread_t *p_input )
{
input_source_t *in = &p_input->p->input;
/* Delete the preexisting titles */
if( in->i_title > 0 )
{
for( int i = 0; i < in->i_title; i++ )
vlc_input_title_Delete( in->title[i] );
TAB_CLEAN( in->i_title, in->title );
in->b_title_demux = false;
}
/* Get the new title list */
if( demux_Control( in->p_demux, DEMUX_GET_TITLE_INFO,
&in->title, &in->i_title,
&in->i_title_offset, &in->i_seekpoint_offset ) )
TAB_INIT( in->i_title, in->title );
else
in->b_title_demux = true;
InitTitle( p_input );
}
/*****************************************************************************
* Update*FromAccess:
......
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