Commit 16b435f0 authored by Laurent Aimar's avatar Laurent Aimar

es_out*: added ES_OUT_DEL_GROUP

 ts.c: use ES_OUT_DEL_GROUP to remove old program.
parent 4bd2fb31
......@@ -80,6 +80,8 @@ enum es_out_query_e
ES_OUT_SET_NEXT_DISPLAY_TIME, /* arg1=es_out_id_t* arg2=int64_t i_pts(microsecond) */
/* Set meta data for group (dynamic) */
ES_OUT_SET_GROUP_META, /* arg1=int i_group arg2=vlc_meta_t */
/* */
ES_OUT_DEL_GROUP, /* arg1=int i_group */
};
struct es_out_t
......
......@@ -2941,6 +2941,7 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
/* Delete PMT pid */
for( i = 0; i < i_pmt_rm; i++ )
{
int i_prg;
if( p_sys->b_dvb_control )
{
if( stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
......@@ -2949,6 +2950,13 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
p_sys->b_dvb_control = VLC_FALSE;
}
for( i_prg = 0; i_prg < pmt_rm[i]->psi->i_prg; i_prg++ )
{
const int i_number = pmt_rm[i]->psi->prg[i_prg]->i_number;
if( i_number != 0 )
es_out_Control( p_demux->out, ES_OUT_DEL_GROUP, i_number );
}
PIDClean( p_demux->out, &p_sys->pid[pmt_rm[i]->i_pid] );
TAB_REMOVE( p_sys->i_pmt, p_sys->pmt, pmt_rm[i] );
}
......
......@@ -1363,6 +1363,12 @@ static int EsOutControl( es_out_t *out, int i_query, va_list args )
EsOutProgramMeta( out, i_group, p_meta );
return VLC_SUCCESS;
}
case ES_OUT_DEL_GROUP:
{
int i_group = (int)va_arg( args, int );
return EsOutProgramDel( out, i_group );
}
default:
msg_Err( p_sys->p_input, "unknown query in es_out_Control" );
......
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