[vlc-commits] commit: Fixed (un)selection of pcr pid in TS demuxer. (Laurent Aimar )

git at videolan.org git at videolan.org
Tue Jul 6 13:08:21 CEST 2010


vlc/vlc-1.1 | branch: master | Laurent Aimar <fenrir at videolan.org> | Mon Jun 28 00:52:53 2010 +0200| [ba1a32ac6c9e0d63f8529571792837018c8928c9] | committer: Jean-Baptiste Kempf 

Fixed (un)selection of pcr pid in TS demuxer.
(cherry picked from commit ba789e5b890e071671fc9310192fa70898dce635)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 modules/demux/ts.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/modules/demux/ts.c b/modules/demux/ts.c
index e499889..bcaa630 100644
--- a/modules/demux/ts.c
+++ b/modules/demux/ts.c
@@ -1281,7 +1281,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
     case DEMUX_SET_GROUP:
     {
         uint16_t i_vpid = 0, i_apid1 = 0, i_apid2 = 0, i_apid3 = 0;
-        ts_prg_psi_t *p_prg = NULL;
+        ts_prg_psi_t *p_prg;
         vlc_list_t *p_list;
 
         i_int = (int)va_arg( args, int );
@@ -1302,6 +1302,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                     if( pmt->psi->prg[i_prg]->i_number == p_sys->i_current_program )
                     {
                         i_pmt_pid = p_sys->pmt[i]->i_pid;
+                        p_prg = p_sys->pmt[i]->psi->prg[i_prg];
                         break;
                     }
                 }
@@ -1313,6 +1314,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
                                 ACCESS_SET_PRIVATE_ID_STATE, i_pmt_pid,
                                 false );
+                if( p_prg->i_pid_pcr > 0 )
+                    stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
+                                    ACCESS_SET_PRIVATE_ID_STATE, p_prg->i_pid_pcr,
+                                    false );
                 /* All ES */
                 for( int i = 2; i < 8192; i++ )
                 {
@@ -1360,9 +1365,10 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
                 stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
                                 ACCESS_SET_PRIVATE_ID_STATE, i_pmt_pid,
                                 true );
-                stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
-                                ACCESS_SET_PRIVATE_ID_STATE, p_prg->i_pid_pcr,
-                                true );
+                if( p_prg->i_pid_pcr > 0 )
+                    stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
+                                    ACCESS_SET_PRIVATE_ID_STATE, p_prg->i_pid_pcr,
+                                    true );
 
                 for( int i = 2; i < 8192; i++ )
                 {



More information about the vlc-commits mailing list