Commit e179dada authored by Gildas Bazin's avatar Gildas Bazin

* src/input/es_out.c: when removing an active track, re-run the track selection algo.

parent 630e3b7a
......@@ -1058,6 +1058,8 @@ static int EsOutSend( es_out_t *out, es_out_id_t *es, block_t *p_block )
static void EsOutDel( es_out_t *out, es_out_id_t *es )
{
es_out_sys_t *p_sys = out->p_sys;
vlc_bool_t b_reselect = VLC_FALSE;
int i;
/* We don't try to reselect */
if( es->p_dec )
......@@ -1074,6 +1076,9 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
msg_Dbg( p_sys->p_input, "Program doesn't contain anymore ES" );
}
if( p_sys->p_es_audio == es || p_sys->p_es_video == es ||
p_sys->p_es_sub == es ) b_reselect = VLC_TRUE;
if( p_sys->p_es_audio == es ) p_sys->p_es_audio = NULL;
if( p_sys->p_es_video == es ) p_sys->p_es_video = NULL;
if( p_sys->p_es_sub == es ) p_sys->p_es_sub = NULL;
......@@ -1091,6 +1096,14 @@ static void EsOutDel( es_out_t *out, es_out_id_t *es )
break;
}
/* Re-select another track when needed */
if( b_reselect )
for( i = 0; i < p_sys->i_es; i++ )
{
if( es->fmt.i_cat == p_sys->es[i]->fmt.i_cat )
EsOutSelect( out, p_sys->es[i], VLC_FALSE );
}
if( es->psz_language )
free( es->psz_language );
if( es->psz_language_code )
......
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