Commit 79e1e221 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

input: always use the demux for titles & seekpoints (fixes #8456)

parent ba6ecd3a
...@@ -75,8 +75,6 @@ static void ControlRelease( int i_type, vlc_value_t val ); ...@@ -75,8 +75,6 @@ static void ControlRelease( int i_type, vlc_value_t val );
static bool ControlIsSeekRequest( int i_type ); static bool ControlIsSeekRequest( int i_type );
static bool Control( input_thread_t *, int, vlc_value_t ); static bool Control( input_thread_t *, int, vlc_value_t );
static int UpdateTitleSeekpointFromAccess( input_thread_t * );
static int UpdateTitleSeekpointFromDemux( input_thread_t * ); static int UpdateTitleSeekpointFromDemux( input_thread_t * );
static void UpdateGenericFromDemux( input_thread_t * ); static void UpdateGenericFromDemux( input_thread_t * );
static void UpdateTitleListfromDemux( input_thread_t * ); static void UpdateTitleListfromDemux( input_thread_t * );
...@@ -575,15 +573,6 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, bool *pb_d ...@@ -575,15 +573,6 @@ static void MainLoopDemux( input_thread_t *p_input, bool *pb_changed, bool *pb_d
} }
UpdateGenericFromDemux( p_input ); UpdateGenericFromDemux( p_input );
} }
else if( p_input->p->input.p_access &&
p_input->p->input.p_access->info.i_update )
{
if( !p_input->p->input.b_title_demux )
{
i_ret = UpdateTitleSeekpointFromAccess( p_input );
*pb_changed = true;
}
}
} }
if( i_ret == 0 ) /* EOF */ if( i_ret == 0 ) /* EOF */
...@@ -1902,9 +1891,7 @@ static bool Control( input_thread_t *p_input, ...@@ -1902,9 +1891,7 @@ static bool Control( input_thread_t *p_input,
if( p_input->p->input.i_title <= 0 ) if( p_input->p->input.i_title <= 0 )
break; break;
int i_title = p_input->p->input.b_title_demux int i_title = p_input->p->input.p_demux->info.i_title;
? p_input->p->input.p_demux->info.i_title
: p_input->p->input.p_access->info.i_title;
if( i_type == INPUT_CONTROL_SET_TITLE_PREV ) if( i_type == INPUT_CONTROL_SET_TITLE_PREV )
i_title--; i_title--;
else if( i_type == INPUT_CONTROL_SET_TITLE_NEXT ) else if( i_type == INPUT_CONTROL_SET_TITLE_NEXT )
...@@ -1915,12 +1902,8 @@ static bool Control( input_thread_t *p_input, ...@@ -1915,12 +1902,8 @@ static bool Control( input_thread_t *p_input,
break; break;
es_out_SetTime( p_input->p->p_es_out, -1 ); es_out_SetTime( p_input->p->p_es_out, -1 );
if( p_input->p->input.b_title_demux ) demux_Control( p_input->p->input.p_demux,
demux_Control( p_input->p->input.p_demux, DEMUX_SET_TITLE, i_title );
DEMUX_SET_TITLE, i_title );
else
stream_Control( p_input->p->input.p_stream,
STREAM_SET_TITLE, i_title );
input_SendEventTitle( p_input, i_title ); input_SendEventTitle( p_input, i_title );
break; break;
} }
...@@ -1936,21 +1919,10 @@ static bool Control( input_thread_t *p_input, ...@@ -1936,21 +1919,10 @@ static bool Control( input_thread_t *p_input,
if( p_input->p->input.i_title <= 0 ) if( p_input->p->input.i_title <= 0 )
break; break;
int i_title, i_seekpoint; demux_t *p_demux = p_input->p->input.p_demux;
if( p_input->p->input.b_title_demux )
{
demux_t *p_demux = p_input->p->input.p_demux;
i_title = p_demux->info.i_title;
i_seekpoint = p_demux->info.i_seekpoint;
}
else
{
access_t *p_access = p_input->p->input.p_access;
i_title = p_access->info.i_title; int i_title = p_demux->info.i_title;
i_seekpoint = p_access->info.i_seekpoint; int i_seekpoint = p_demux->info.i_seekpoint;
}
if( i_type == INPUT_CONTROL_SET_SEEKPOINT_PREV ) if( i_type == INPUT_CONTROL_SET_SEEKPOINT_PREV )
{ {
...@@ -1973,12 +1945,8 @@ static bool Control( input_thread_t *p_input, ...@@ -1973,12 +1945,8 @@ static bool Control( input_thread_t *p_input,
break; break;
es_out_SetTime( p_input->p->p_es_out, -1 ); es_out_SetTime( p_input->p->p_es_out, -1 );
if( p_input->p->input.b_title_demux ) demux_Control( p_input->p->input.p_demux,
demux_Control( p_input->p->input.p_demux, DEMUX_SET_SEEKPOINT, i_seekpoint );
DEMUX_SET_SEEKPOINT, i_seekpoint );
else
stream_Control( p_input->p->input.p_stream,
STREAM_SET_SEEKPOINT, i_seekpoint );
input_SendEventSeekpoint( p_input, i_title, i_seekpoint ); input_SendEventSeekpoint( p_input, i_title, i_seekpoint );
break; break;
} }
...@@ -2241,36 +2209,6 @@ static void UpdateTitleListfromDemux( input_thread_t *p_input ) ...@@ -2241,36 +2209,6 @@ static void UpdateTitleListfromDemux( input_thread_t *p_input )
} }
/*****************************************************************************
* Update*FromAccess:
*****************************************************************************/
static int UpdateTitleSeekpointFromAccess( input_thread_t *p_input )
{
access_t *p_access = p_input->p->input.p_access;
if( p_access->info.i_update & INPUT_UPDATE_TITLE )
{
input_SendEventTitle( p_input, p_access->info.i_title );
stream_Control( p_input->p->input.p_stream, STREAM_UPDATE_SIZE );
p_access->info.i_update &= ~INPUT_UPDATE_TITLE;
}
if( p_access->info.i_update & INPUT_UPDATE_SEEKPOINT )
{
input_SendEventSeekpoint( p_input,
p_access->info.i_title, p_access->info.i_seekpoint );
p_access->info.i_update &= ~INPUT_UPDATE_SEEKPOINT;
}
/* Hmmm only works with master input */
if( p_input->p->input.p_access == p_access )
return UpdateTitleSeekpoint( p_input,
p_access->info.i_title,
p_access->info.i_seekpoint );
return 1;
}
/***************************************************************************** /*****************************************************************************
* InputSourceNew: * InputSourceNew:
*****************************************************************************/ *****************************************************************************/
...@@ -2498,10 +2436,6 @@ static int InputSourceInit( input_thread_t *p_input, ...@@ -2498,10 +2436,6 @@ static int InputSourceInit( input_thread_t *p_input,
var_SetBool( p_input, "can-seek", b ); var_SetBool( p_input, "can-seek", b );
in->b_title_demux = false; in->b_title_demux = false;
if( stream_Control( in->p_stream, STREAM_GET_TITLE_INFO,
&in->title, &in->i_title, &in->i_title_offset,
&in->i_seekpoint_offset ) )
TAB_INIT( in->i_title, in->title );
} }
in->p_demux = demux_New( p_input, p_input, psz_access, psz_demux, in->p_demux = demux_New( p_input, p_input, psz_access, psz_demux,
......
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