/*****************************************************************************
* 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>
}
}
#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 */
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 );
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;
- }
}
}
}