]> git.sesse.net Git - vlc/blobdiff - modules/demux/ts.c
Copyright fixes
[vlc] / modules / demux / ts.c
index 11e01d3869f92dacead839973c5e0c641bc490a9..231126119f4c41ea7939bf73b305a8da4b2624d3 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * ts.c: Transport Stream input module for VLC.
  *****************************************************************************
- * Copyright (C) 2004 VideoLAN
+ * Copyright (C) 2004 VideoLAN (Centrale Réseaux) and its contributors
  * $Id$
  *
  * Authors: Laurent Aimar <fenrir@via.ecp.fr>
@@ -2114,12 +2114,12 @@ static void DecodeMjd( int i_mjd, int *p_y, int *p_m, int *p_d )
     }
 }
 #endif
-static void EITEventFixString( char *psz )
+static void EITEventFixString( unsigned char *psz )
 {
     int i_len;
     /* Sometimes the first char isn't a normal char but designed
      * caracters encoding, for now lets skip it */
-    if( isalnum(psz[0]) )
+    if( psz[0] >= 0x20 )
             return;
     if( ( i_len = strlen( psz ) ) > 0 )
         memmove( &psz[0], &psz[1], i_len ); /* Copy the \0 too */
@@ -2420,9 +2420,22 @@ static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt )
 
         if( !old_pid && p_sys->pid[p_es->i_pid].b_valid )
         {
-            msg_Warn( p_demux, "pmt error: pid=%d already defined",
-                      p_es->i_pid );
-            continue;
+            ts_pid_t *pid = &p_sys->pid[p_es->i_pid];
+            if( ( pid->i_pid == 0x11 /* SDT */ ||
+                  pid->i_pid == 0x12 /* EDT */ ) && pid->psi )
+            {
+                /* This doesn't look like a DVB stream so don't try
+                 * parsing the SDT/EDT */
+                dvbpsi_DetachDemux( pid->psi->handle );
+                free( pid->psi );
+                pid->psi = 0;
+            }
+            else
+            {
+                msg_Warn( p_demux, "pmt error: pid=%d already defined",
+                          p_es->i_pid );
+                continue;
+            }
         }
 
         PIDInit( pid, VLC_FALSE, pmt->psi );
@@ -3015,11 +3028,6 @@ static void PATCallBack( demux_t *p_demux, dvbpsi_pat_t *p_pat )
                         if( stream_Control( p_demux->s, STREAM_CONTROL_ACCESS, ACCESS_SET_PRIVATE_ID_STATE, p_program->i_pid, VLC_TRUE ) )
                             p_sys->b_dvb_control = VLC_FALSE;
                     }
-                    else
-                    {
-                        if( stream_Control( p_demux->s, STREAM_CONTROL_ACCESS, ACCESS_SET_PRIVATE_ID_STATE, p_program->i_pid, VLC_FALSE ) )
-                            p_sys->b_dvb_control = VLC_FALSE;
-                    }
                 }
             }
         }