- /* FIXME : PSIDemux and PSIDecode */
- /* Add audio and video programs */
- /* p_input->stream.pp_programs[0] = */
- input_AddProgram( p_input, 0, sizeof( pgrm_ts_data_t ) );
- p_pgrm_demux =
- (pgrm_ts_data_t *)p_input->stream.pp_programs[0]->p_demux_data;
- p_pgrm_demux->i_pcr_pid = 0x78;
-
- kludge1 = input_AddES( p_input, p_input->stream.pp_programs[0],
- 0x78, sizeof( es_ts_data_t ) );
-
- // kludge
- kludge1->i_type = MPEG2_VIDEO_ES;
-
- input_SelectES( p_input, kludge1 );
-
- vlc_mutex_lock( &(p_input->stream.stream_lock) );
- p_input->stream.pp_programs[0]->b_is_ok = 1;
- vlc_mutex_unlock( &(p_input->stream.stream_lock) );
-
-//debug
-intf_ErrMsg("End of TSINIT");
+ /* Init */
+ p_stream_data = (stream_ts_data_t *)p_input->stream.p_demux_data;
+ p_stream_data->i_pat_version = PAT_UNINITIALIZED ;
+
+ /* We'll have to catch the PAT in order to continue
+ * Then the input will catch the PMT and then the others ES
+ * The PAT es is indepedent of any program. */
+ p_pat_es = input_AddES( p_input, NULL,
+ 0x00, sizeof( es_ts_data_t ) );
+ p_demux_data=(es_ts_data_t *)p_pat_es->p_demux_data;
+ p_demux_data->b_psi = 1;
+ p_demux_data->i_psi_type = PSI_IS_PAT;
+ p_demux_data->p_psi_section = malloc(sizeof(psi_section_t));
+ p_demux_data->p_psi_section->b_is_complete = 1;
+