[vlc-commits] demux: ts: missing PCR repick for no-trust-pcr

Francois Cartegnie git at videolan.org
Mon Feb 23 01:45:46 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Feb 22 22:30:36 2015 +0100| [723b35b50193ff177590b54bfa5ca55fae9fe6dc] | committer: Francois Cartegnie

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

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=723b35b50193ff177590b54bfa5ca55fae9fe6dc
---

 modules/demux/ts.c |   13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index 502c828..6e3ce09 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -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 )
 {
     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++ )
     {
         ts_pid_t *p_pid = &p_sys->pid[i];
         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 */
             {
@@ -5568,6 +5570,15 @@ static void PMTCallBack( void *data, dvbpsi_pmt_t *p_pmt )
     if( i_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 */
     if( p_sys->b_canfastseek && prg->i_last_dts == -1 )
     {



More information about the vlc-commits mailing list