Commit d01842e5 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: ts: handle PCR less pid (fix #13339)

Because the no-trust-pcr thing isn't a real fix.
parent 5f617560
......@@ -2363,11 +2363,29 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk )
for( int i_prg = 0; i_prg < p_sys->pmt[i]->psi->i_prg; i_prg++ )
{
if( pid->i_pid == p_sys->pmt[i]->psi->prg[i_prg]->i_pid_pcr )
ts_prg_psi_t *p_prg = p_sys->pmt[i]->psi->prg[i_prg];
if( p_prg->i_pid_pcr == 0x1FFF ) /* That program has no dedicated PCR pid ISO/IEC 13818-1 2.4.4.9 */
{
if( pid->p_owner ) /* PCR shall be on pid itself */
{
p_prg->i_pcr_value = i_pcr; /* ? update PCR for the whole group program */
i_group = p_prg->i_number;
b_pmt_has_es = pid->es;
}
else
{
/* We've found our target group */
p_sys->pmt[i]->psi->prg[i_prg]->i_pcr_value = i_pcr;
i_group = p_sys->pmt[i]->psi->prg[i_prg]->i_number;
msg_Warn(p_demux, "discarding PCR update from pid %d which has no owner", pid->i_pid);
}
break;
}
else /* set PCR provided by current pid to program(s) referencing it */
{
/* Can be dedicated PCR pid (no owned then) or another pid (owner == pmt) */
if( p_prg->i_pid_pcr == pid->i_pid ) /* If that program references current pid as PCR */
{
p_prg->i_pcr_value = i_pcr;
i_group = p_prg->i_number; /* We've found a target group for update */
for( int j = 0; j < 8192; j++ )
{
const ts_pid_t *pid = &p_sys->pid[j];
......@@ -2379,6 +2397,7 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk )
}
}
}
}
if ( p_sys->b_trust_pcr && i_group > 0 && b_pmt_has_es )
es_out_Control( p_demux->out, ES_OUT_SET_GROUP_PCR,
......
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