Commit 723b35b5 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: ts: missing PCR repick for no-trust-pcr

parent caf8d8af
...@@ -3034,11 +3034,13 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk ) ...@@ -3034,11 +3034,13 @@ static void PCRHandle( demux_t *p_demux, ts_pid_t *pid, block_t *p_bk )
static int FindPCRCandidate( demux_sys_t *p_sys, ts_prg_psi_t *p_prg ) static int FindPCRCandidate( demux_sys_t *p_sys, ts_prg_psi_t *p_prg )
{ {
ts_pid_t *p_cand = NULL; ts_pid_t *p_cand = NULL;
int i_previous = p_prg->i_pid_pcr;
for( int i=MIN_ES_PID; i<=MAX_ES_PID; i++ ) for( int i=MIN_ES_PID; i<=MAX_ES_PID; i++ )
{ {
ts_pid_t *p_pid = &p_sys->pid[i]; ts_pid_t *p_pid = &p_sys->pid[i];
if( p_pid->b_seen && p_pid->es && p_pid->es->id && if( p_pid->b_seen && p_pid->es && p_pid->es->id &&
p_pid->i_owner_number == p_prg->i_number ) p_pid->i_owner_number == p_prg->i_number &&
p_cand->i_pid != i_previous )
{ {
if( p_pid->probed.i_pcr_count ) /* check PCR frequency first */ if( p_pid->probed.i_pcr_count ) /* check PCR frequency first */
{ {
...@@ -5568,6 +5570,15 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt ) ...@@ -5568,6 +5570,15 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt )
if( i_clean ) if( i_clean )
free( pp_clean ); free( pp_clean );
if( !p_sys->b_trust_pcr )
{
int i_cand = FindPCRCandidate( p_demux->p_sys, prg );
prg->i_pid_pcr = i_cand;
prg->pcr.b_disable = true;
msg_Warn( p_demux, "PCR not trusted for program %d, set up workaround using pid %d",
prg->i_number, i_cand );
}
/* Probe Boundaries */ /* Probe Boundaries */
if( p_sys->b_canfastseek && prg->i_last_dts == -1 ) if( p_sys->b_canfastseek && prg->i_last_dts == -1 )
{ {
......
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