Commit 50accb82 authored by François Cartegnie's avatar François Cartegnie 🤞

demux: ts: delete/and recreate es on format change

refs #14257
parent ead70b81
......@@ -5446,34 +5446,13 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_dvbpsipmt )
p_pes->es.fmt.psz_language ) ) ) )
{
/* Differs, swap then */
ts_pes_t *e = pespid->u.p_pes;
ts_pes_t *old = pespid->u.p_pes;
pespid->u.p_pes = p_pes;
p_pes = e;
/* p_pes still tmp, but now contains old config */
pespid->u.p_pes->es.id = p_pes->es.id;
if( pespid->u.p_pes->es.id )
{
p_pes->es.id = NULL;
es_out_Control( p_demux->out, ES_OUT_SET_ES_FMT,
pespid->u.p_pes->es.id, &pespid->u.p_pes->es.fmt );
}
for( int i=0; i<pespid->u.p_pes->extra_es.i_size &&
i<p_pes->extra_es.i_size; i++ )
{
pespid->u.p_pes->extra_es.p_elems[i]->id = p_pes->extra_es.p_elems[i]->id;
if( pespid->u.p_pes->extra_es.p_elems[i]->id )
{
es_out_Control( p_demux->out, ES_OUT_SET_ES_FMT,
pespid->u.p_pes->extra_es.p_elems[i]->id,
&pespid->u.p_pes->extra_es.p_elems[i]->fmt );
p_pes->extra_es.p_elems[i]->id = NULL;
}
}
AddAndCreateES( p_demux, pespid, false );
ts_pes_Del( p_demux, old );
}
ts_pes_Del( p_demux, p_pes ); // delete temp
else
ts_pes_Del( p_demux, p_pes ); // delete temp, stay with current es/es_id
}
else
{
......
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