+++ /dev/null
-Index: modules/access/dtv/en50221.c
-===================================================================
---- modules/access/dtv/en50221.c.orig
-+++ modules/access/dtv/en50221.c
-@@ -2231,13 +2231,13 @@ int en50221_SetCAPMT( cam_t * p_cam, dvb
-
- if ( !b_needs_descrambling )
- {
-- dvbpsi_DeletePMT( p_pmt );
-+ dvbpsi_pmt_delete( p_pmt );
- p_pmt = p_cam->pp_selected_programs[i];
- p_cam->pp_selected_programs[i] = NULL;
- }
- else if( p_pmt != p_cam->pp_selected_programs[i] )
- {
-- dvbpsi_DeletePMT( p_cam->pp_selected_programs[i] );
-+ dvbpsi_pmt_delete( p_cam->pp_selected_programs[i] );
- p_cam->pp_selected_programs[i] = p_pmt;
- }
-
-@@ -2276,7 +2276,7 @@ int en50221_SetCAPMT( cam_t * p_cam, dvb
-
- if ( !b_needs_descrambling )
- {
-- dvbpsi_DeletePMT( p_pmt );
-+ dvbpsi_pmt_delete( p_pmt );
- }
-
- return VLC_SUCCESS;
-@@ -2651,7 +2651,7 @@ void en50221_End( cam_t * p_cam )
- {
- if( p_cam->pp_selected_programs[i] != NULL )
- {
-- dvbpsi_DeletePMT( p_cam->pp_selected_programs[i] );
-+ dvbpsi_pmt_delete( p_cam->pp_selected_programs[i] );
- }
- }
-
-Index: modules/demux/ts.c
-===================================================================
---- modules/demux/ts.c.orig 2013-02-08 13:31:21.000000000 +0100
-+++ modules/demux/ts.c 2013-07-27 08:34:12.650364561 +0200
-@@ -272,7 +272,7 @@
-
- typedef struct
- {
-- dvbpsi_handle handle;
-+ dvbpsi_t *handle;
-
- int i_version;
- int i_number;
-@@ -286,7 +286,7 @@
- typedef struct
- {
- /* for special PAT/SDT case */
-- dvbpsi_handle handle; /* PAT/SDT/EIT */
-+ dvbpsi_t *handle; /* PAT/SDT/EIT */
- int i_pat_version;
- int i_sdt_version;
-
-@@ -407,7 +407,7 @@
-
- static void PATCallBack( demux_t *, dvbpsi_pat_t * );
- static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt );
--static void PSINewTableCallBack( demux_t *, dvbpsi_handle,
-+static void PSINewTableCallBack( demux_t *, dvbpsi_t *,
- uint8_t i_table_id, uint16_t i_extension );
- static int ChangeKeyCallback( vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void * );
-
-@@ -667,7 +667,8 @@
- /* Init PAT handler */
- pat = &p_sys->pid[0];
- PIDInit( pat, true, NULL );
-- pat->psi->handle = dvbpsi_AttachPAT( (dvbpsi_pat_callback)PATCallBack,
-+ pat->psi->handle = dvbpsi_new(NULL, 0);
-+ dvbpsi_pat_attach( pat->psi->handle, (dvbpsi_pat_callback)PATCallBack,
- p_demux );
- if( p_sys->b_dvb_meta )
- {
-@@ -675,18 +676,18 @@
- ts_pid_t *eit = &p_sys->pid[0x12];
-
- PIDInit( sdt, true, NULL );
-- sdt->psi->handle =
-- dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
-+ sdt->psi->handle = dvbpsi_new(NULL, 0);
-+ dvbpsi_AttachDemux( sdt->psi->handle, (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
- p_demux );
- PIDInit( eit, true, NULL );
-- eit->psi->handle =
-- dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
-+ eit->psi->handle = dvbpsi_new(NULL, 0);
-+ dvbpsi_AttachDemux( eit->psi->handle, (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
- p_demux );
- #ifdef TS_USE_TDT
- ts_pid_t *tdt = &p_sys->pid[0x14];
- PIDInit( tdt, true, NULL );
-- tdt->psi->handle =
-- dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
-+ tdt->psi->handle = dvbpsi_new(NULL, 0);
-+ dvbpsi_AttachDemux( tdt->psi->handle, (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
- p_demux );
- #endif
- if( p_sys->b_access_control )
-@@ -850,7 +851,7 @@
- switch( pid->i_pid )
- {
- case 0: /* PAT */
-- dvbpsi_DetachPAT( pid->psi->handle );
-+ dvbpsi_pat_detach( pid->psi->handle );
- free( pid->psi );
- break;
- case 1: /* CAT */
-@@ -1089,13 +1090,13 @@
- {
- if( p_pid->i_pid == 0 || ( p_sys->b_dvb_meta && ( p_pid->i_pid == 0x11 || p_pid->i_pid == 0x12 || p_pid->i_pid == 0x14 ) ) )
- {
-- dvbpsi_PushPacket( p_pid->psi->handle, p_pkt->p_buffer );
-+ dvbpsi_packet_push( p_pid->psi->handle, p_pkt->p_buffer );
- }
- else
- {
- for( int i_prg = 0; i_prg < p_pid->psi->i_prg; i_prg++ )
- {
-- dvbpsi_PushPacket( p_pid->psi->prg[i_prg]->handle,
-+ dvbpsi_packet_push( p_pid->psi->prg[i_prg]->handle,
- p_pkt->p_buffer );
- }
- }
-@@ -1372,7 +1373,8 @@
- prg->i_pid_pmt = -1;
- prg->i_version = -1;
- prg->i_number = i_number != 0 ? i_number : TS_USER_PMT_NUMBER;
-- prg->handle = dvbpsi_AttachPMT( i_number != TS_USER_PMT_NUMBER ? i_number : 1, (dvbpsi_pmt_callback)PMTCallBack, p_demux );
-+ prg->handle = dvbpsi_new(NULL, 0);
-+ dvbpsi_pmt_attach( prg->handle, i_number != TS_USER_PMT_NUMBER ? i_number : 1, (dvbpsi_pmt_callback)PMTCallBack, p_demux );
- TAB_APPEND( pmt->psi->i_prg, pmt->psi->prg, prg );
-
- psz = strchr( psz, '=' );
-@@ -1588,13 +1590,13 @@
- if( pid->psi )
- {
- if( pid->psi->handle )
-- dvbpsi_DetachPMT( pid->psi->handle );
-+ dvbpsi_pmt_detach( pid->psi->handle );
- for( int i = 0; i < pid->psi->i_prg; i++ )
- {
- if( pid->psi->prg[i]->iod )
- IODFree( pid->psi->prg[i]->iod );
- if( pid->psi->prg[i]->handle )
-- dvbpsi_DetachPMT( pid->psi->prg[i]->handle );
-+ dvbpsi_pmt_detach( pid->psi->prg[i]->handle );
- free( pid->psi->prg[i] );
- }
- free( pid->psi->prg );
-@@ -2937,14 +2939,14 @@
- ( !p_sdt->b_current_next ||
- p_sdt->i_version == sdt->psi->i_sdt_version ) )
- {
-- dvbpsi_DeleteSDT( p_sdt );
-+ dvbpsi_sdt_delete( p_sdt );
- return;
- }
-
-- msg_Dbg( p_demux, "new SDT ts_id=%d version=%d current_next=%d "
-+/* msg_Dbg( p_demux, "new SDT ts_id=%d version=%d current_next=%d "
- "network_id=%d",
- p_sdt->i_ts_id, p_sdt->i_version, p_sdt->b_current_next,
-- p_sdt->i_network_id );
-+ p_sdt->i_network_id ); */
-
- p_sys->b_broken_charset = false;
-
-@@ -3055,7 +3057,7 @@
- }
-
- sdt->psi->i_sdt_version = p_sdt->i_version;
-- dvbpsi_DeleteSDT( p_sdt );
-+ dvbpsi_sdt_delete( p_sdt );
- }
-
- /* i_year: year - 1900 i_month: 0-11 i_mday: 1-31 i_hour: 0-23 i_minute: 0-59 i_second: 0-59 */
-@@ -3125,7 +3127,7 @@
-
- p_sys->i_tdt_delta = CLOCK_FREQ * EITConvertStartTime( p_tdt->i_utc_time )
- - mdate();
-- dvbpsi_DeleteTOT(p_tdt);
-+ dvbpsi_tot_delete(p_tdt);
- }
- #endif
-
-@@ -3140,16 +3142,16 @@
- msg_Dbg( p_demux, "EITCallBack called" );
- if( !p_eit->b_current_next )
- {
-- dvbpsi_DeleteEIT( p_eit );
-+ dvbpsi_eit_delete( p_eit );
- return;
- }
-
-- msg_Dbg( p_demux, "new EIT service_id=%d version=%d current_next=%d "
-+/* msg_Dbg( p_demux, "new EIT service_id=%d version=%d current_next=%d "
- "ts_id=%d network_id=%d segment_last_section_number=%d "
- "last_table_id=%d",
- p_eit->i_service_id, p_eit->i_version, p_eit->b_current_next,
- p_eit->i_ts_id, p_eit->i_network_id,
-- p_eit->i_segment_last_section_number, p_eit->i_last_table_id );
-+ p_eit->i_segment_last_section_number, p_eit->i_last_table_id ); */
-
- p_epg = vlc_epg_New( NULL );
- for( p_evt = p_eit->p_first_event; p_evt; p_evt = p_evt->p_next )
-@@ -3277,7 +3279,7 @@
- }
- vlc_epg_Delete( p_epg );
-
-- dvbpsi_DeleteEIT( p_eit );
-+ dvbpsi_eit_delete( p_eit );
- }
- static void EITCallBackCurrentFollowing( demux_t *p_demux, dvbpsi_eit_t *p_eit )
- {
-@@ -3288,7 +3290,7 @@
- EITCallBack( p_demux, p_eit, false );
- }
-
--static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_handle h,
-+static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_t *h,
- uint8_t i_table_id, uint16_t i_extension )
- {
- #if 0
-@@ -3300,7 +3302,7 @@
- msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
- i_table_id, i_table_id, i_extension, i_extension );
-
-- dvbpsi_AttachSDT( h, i_table_id, i_extension,
-+ dvbpsi_sdt_attach( h, i_table_id, i_extension,
- (dvbpsi_sdt_callback)SDTCallBack, p_demux );
- }
- else if( p_demux->p_sys->pid[0x11].psi->i_sdt_version != -1 &&
-@@ -3313,7 +3315,7 @@
- dvbpsi_eit_callback cb = i_table_id == 0x4e ?
- (dvbpsi_eit_callback)EITCallBackCurrentFollowing :
- (dvbpsi_eit_callback)EITCallBackSchedule;
-- dvbpsi_AttachEIT( h, i_table_id, i_extension, cb, p_demux );
-+ dvbpsi_eit_attach( h, i_table_id, i_extension, cb, p_demux );
- }
- #ifdef TS_USE_TDT
- else if( p_demux->p_sys->pid[0x11].psi->i_sdt_version != -1 &&
-@@ -3321,7 +3323,7 @@
- {
- msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
- i_table_id, i_table_id, i_extension, i_extension );
-- dvbpsi_AttachTOT( h, i_table_id, i_extension,
-+ dvbpsi_tot_attach( h, i_table_id, i_extension,
- (dvbpsi_tot_callback)TDTCallBack, p_demux);
- }
- #endif
-@@ -4118,14 +4120,14 @@
- if( pmt == NULL )
- {
- msg_Warn( p_demux, "unreferenced program (broken stream)" );
-- dvbpsi_DeletePMT(p_pmt);
-+ dvbpsi_pmt_delete(p_pmt);
- return;
- }
-
- if( prg->i_version != -1 &&
- ( !p_pmt->b_current_next || prg->i_version == p_pmt->i_version ) )
- {
-- dvbpsi_DeletePMT( p_pmt );
-+ dvbpsi_pmt_delete( p_pmt );
- return;
- }
-
-@@ -4354,7 +4356,7 @@
- if( !ProgramIsSelected( p_demux, prg->i_number )
- || stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
- ACCESS_SET_PRIVATE_ID_CA, p_pmt ) != VLC_SUCCESS )
-- dvbpsi_DeletePMT( p_pmt );
-+ dvbpsi_pmt_delete( p_pmt );
-
- for( int i = 0; i < i_clean; i++ )
- {
-@@ -4382,7 +4384,7 @@
- p_pat->i_version == pat->psi->i_pat_version ) ) ||
- p_sys->b_user_pmt )
- {
-- dvbpsi_DeletePAT( p_pat );
-+ dvbpsi_pat_delete( p_pat );
- return;
- }
-
-@@ -4504,7 +4506,7 @@
- {
- PIDInit( pmt, true, pat->psi );
- pmt->psi->prg[pmt->psi->i_prg-1]->handle =
-- dvbpsi_AttachPMT( p_program->i_number,
-+ dvbpsi_pmt_attach( p_program->i_number,
- (dvbpsi_pmt_callback)PMTCallBack,
- p_demux );
- pmt->psi->prg[pmt->psi->i_prg-1]->i_number =
-@@ -4526,5 +4528,5 @@
- }
- pat->psi->i_pat_version = p_pat->i_version;
-
-- dvbpsi_DeletePAT( p_pat );
-+ dvbpsi_pat_delete( p_pat );
- }
-Index: modules/mux/mpeg/ts.c
-===================================================================
---- modules/mux/mpeg/ts.c.orig
-+++ modules/mux/mpeg/ts.c
-@@ -2333,15 +2333,15 @@ static void GetPAT( sout_mux_t *p_mux,
- dvbpsi_psi_section_t *p_section;
- int i;
-
-- dvbpsi_InitPAT( &pat, p_sys->i_tsid, p_sys->i_pat_version_number,
-+ dvbpsi_pat_init( &pat, p_sys->i_tsid, p_sys->i_pat_version_number,
- 1 ); /* b_current_next */
- /* add all programs */
- for ( i = 0; i < p_sys->i_num_pmt; i++ )
-- dvbpsi_PATAddProgram( &pat,
-+ dvbpsi_pat_program_add( &pat,
- p_sys->i_pmt_program_number[i],
- p_sys->pmt[i].i_pid );
-
-- p_section = dvbpsi_GenPATSections( &pat,
-+ p_section = dvbpsi_pat_sections_generate( &pat,
- 0 ); /* max program per section */
-
- p_pat = WritePSISection( p_mux->p_sout, p_section );
-@@ -2349,7 +2349,7 @@ static void GetPAT( sout_mux_t *p_mux,
- PEStoTS( p_mux->p_sout, c, p_pat, &p_sys->pat );
-
- dvbpsi_DeletePSISections( p_section );
-- dvbpsi_EmptyPAT( &pat );
-+ dvbpsi_pat_empty( &pat );
- }
-
- static uint32_t GetDescriptorLength24b( int i_length )
-@@ -2394,11 +2394,11 @@ static void GetPMT( sout_mux_t *p_mux, s
- }
-
- if( p_sys->b_sdt )
-- dvbpsi_InitSDT( &sdt, p_sys->i_tsid, 1, 1, p_sys->i_netid );
-+ dvbpsi_sdt_init( &sdt, p_sys->i_tsid, 1, 1, p_sys->i_netid );
-
- for( i = 0; i < p_sys->i_num_pmt; i++ )
- {
-- dvbpsi_InitPMT( &p_sys->dvbpmt[i],
-+ dvbpsi_pmt_init( &p_sys->dvbpmt[i],
- p_sys->i_pmt_program_number[i], /* program number */
- p_sys->i_pmt_version_number,
- 1, /* b_current_next */
-@@ -2406,7 +2406,7 @@ static void GetPMT( sout_mux_t *p_mux, s
-
- if( p_sys->b_sdt )
- {
-- p_service = dvbpsi_SDTAddService( &sdt,
-+ p_service = dvbpsi_sdt_service_add( &sdt,
- p_sys->i_pmt_program_number[i], /* service id */
- 0, /* eit schedule */
- 0, /* eit present */
-@@ -2435,7 +2435,7 @@ static void GetPMT( sout_mux_t *p_mux, s
- memcpy( &psz_sdt_desc[3+strlen(psz_sdtprov)], psz_sdtserv,
- strlen(psz_sdtserv) );
-
-- dvbpsi_SDTServiceAddDescriptor( p_service, 0x48,
-+ dvbpsi_sdt_service_descriptor_add( p_service, 0x48,
- 3 + strlen(psz_sdtprov) + strlen(psz_sdtserv),
- (uint8_t *)psz_sdt_desc );
- free( psz_sdt_desc );
-@@ -2590,13 +2590,13 @@ static void GetPMT( sout_mux_t *p_mux, s
- p_usepid = bsearch( &p_usepid, p_sys->pmtmap, p_sys->i_num_pmt,
- sizeof(pmt_map_t), pmtcompare );
- if( p_usepid != NULL )
-- dvbpsi_PMTAddDescriptor(
-+ dvbpsi_pmt_descriptor_add(
- &p_sys->dvbpmt[((pmt_map_t *)p_usepid)->i_prog], 0x1d,
- bits.i_data, bits.p_data );
- else
- msg_Err( p_mux, "Received an unmapped PID" );
- #else
-- dvbpsi_PMTAddDescriptor( &p_sys->dvbpmt[0], 0x1d, bits.i_data,
-+ dvbpsi_pmt_descriptor_add( &p_sys->dvbpmt[0], 0x1d, bits.i_data,
- bits.p_data );
- #endif
- }
-@@ -2612,12 +2612,12 @@ static void GetPMT( sout_mux_t *p_mux, s
- sizeof(pmt_map_t), intcompare );
-
- if( p_usepid != NULL )
-- p_es = dvbpsi_PMTAddES(
-+ p_es = dvbpsi_pmt_es_add(
- &p_sys->dvbpmt[((pmt_map_t *)p_usepid)->i_prog],
- p_stream->i_stream_type, p_stream->i_pid );
- else
- /* If there's an error somewhere, dump it to the first pmt */
-- p_es = dvbpsi_PMTAddES( &p_sys->dvbpmt[0], p_stream->i_stream_type,
-+ p_es = dvbpsi_pmt_es_add( &p_sys->dvbpmt[0], p_stream->i_stream_type,
- p_stream->i_pid );
-
- if( p_stream->i_stream_id == 0xfa || p_stream->i_stream_id == 0xfb )
-@@ -2627,7 +2627,7 @@ static void GetPMT( sout_mux_t *p_mux, s
- /* SL descriptor */
- es_id[0] = (p_stream->i_es_id >> 8)&0xff;
- es_id[1] = (p_stream->i_es_id)&0xff;
-- dvbpsi_PMTESAddDescriptor( p_es, 0x1f, 2, es_id );
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x1f, 2, es_id );
- }
- else if( p_stream->i_stream_type == 0xa0 )
- {
-@@ -2648,21 +2648,21 @@ static void GetPMT( sout_mux_t *p_mux, s
- }
-
- /* 0xa0 is private */
-- dvbpsi_PMTESAddDescriptor( p_es, 0xa0, i_extra + 10, data );
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0xa0, i_extra + 10, data );
- }
- else if( p_stream->i_stream_type == 0x81 )
- {
- uint8_t format[4] = { 0x41, 0x43, 0x2d, 0x33 };
-
- /* "registration" descriptor : "AC-3" */
-- dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, format );
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, format );
- }
- else if( p_stream->i_codec == VLC_CODEC_DIRAC )
- {
- /* Dirac registration descriptor */
-
- uint8_t data[4] = { 'd', 'r', 'a', 'c' };
-- dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
- }
- else if( p_stream->i_codec == VLC_CODEC_DTS )
- {
-@@ -2670,18 +2670,18 @@ static void GetPMT( sout_mux_t *p_mux, s
-
- /* DTS format identifier, frame size 1024 - FIXME */
- uint8_t data[4] = { 0x44, 0x54, 0x53, 0x32 };
-- dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
- }
- else if( p_stream->i_codec == VLC_CODEC_EAC3 )
- {
- uint8_t data[1] = { 0x00 };
-- dvbpsi_PMTESAddDescriptor( p_es, 0x7a, 1, data );
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x7a, 1, data );
- }
- else if( p_stream->i_codec == VLC_CODEC_TELETEXT )
- {
- if( p_stream->i_decoder_specific_info )
- {
-- dvbpsi_PMTESAddDescriptor( p_es, 0x56,
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x56,
- p_stream->i_decoder_specific_info,
- p_stream->p_decoder_specific_info );
- }
-@@ -2693,7 +2693,7 @@ static void GetPMT( sout_mux_t *p_mux, s
- if( p_stream->i_decoder_specific_info )
- {
- /* pass-through from the TS demux */
-- dvbpsi_PMTESAddDescriptor( p_es, 0x59,
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x59,
- p_stream->i_decoder_specific_info,
- p_stream->p_decoder_specific_info );
- }
-@@ -2714,7 +2714,7 @@ static void GetPMT( sout_mux_t *p_mux, s
-
- p_descr = dvbpsi_GenSubtitlingDr( &descr, 0 );
- /* Work around bug in old libdvbpsi */ p_descr->i_length = 8;
-- dvbpsi_PMTESAddDescriptor( p_es, p_descr->i_tag,
-+ dvbpsi_pmt_es_descriptor_add( p_es, p_descr->i_tag,
- p_descr->i_length, p_descr->p_data );
- }
- continue;
-@@ -2733,22 +2733,22 @@ static void GetPMT( sout_mux_t *p_mux, s
- data[i*4+2] = p_stream->lang[i*3+2];
- data[i*4+3] = 0x00; /* audio type: 0x00 undefined */
- }
-- dvbpsi_PMTESAddDescriptor( p_es, 0x0a, 4*p_stream->i_langs, data );
-+ dvbpsi_pmt_es_descriptor_add( p_es, 0x0a, 4*p_stream->i_langs, data );
- }
- }
-
- for( i = 0; i < p_sys->i_num_pmt; i++ )
- {
-- p_section[i] = dvbpsi_GenPMTSections( &p_sys->dvbpmt[i] );
-+ p_section[i] = dvbpsi_pmt_sections_generate( &p_sys->dvbpmt[i] );
- p_pmt[i] = WritePSISection( p_mux->p_sout, p_section[i] );
- PEStoTS( p_mux->p_sout, c, p_pmt[i], &p_sys->pmt[i] );
- dvbpsi_DeletePSISections( p_section[i] );
-- dvbpsi_EmptyPMT( &p_sys->dvbpmt[i] );
-+ dvbpsi_pmt_empty( &p_sys->dvbpmt[i] );
- }
-
- if( p_sys->b_sdt )
- {
-- p_section2 = dvbpsi_GenSDTSections( &sdt );
-+ p_section2 = dvbpsi_sdt_sections_generate( &sdt );
- p_sdt = WritePSISection( p_mux->p_sout, p_section2 );
- PEStoTS( p_mux->p_sout, c, p_sdt, &p_sys->sdt );
- dvbpsi_DeletePSISections( p_section2 );
---- modules/demux/ts.c.orig 2013-08-08 19:38:57.049290576 +0200
-+++ modules/demux/ts.c 2013-08-09 16:06:44.526199046 +0200
-@@ -3264,7 +3264,7 @@
- {
- if( b_current_following &&
- ( p_sys->i_current_program == -1 ||
-- p_sys->i_current_program == p_eit->i_service_id ) )
-+ p_sys->i_current_program == p_eit->i_extension ) )
- {
- p_sys->i_dvb_length = 0;
- p_sys->i_dvb_start = 0;
-@@ -3275,7 +3275,7 @@
- p_sys->i_dvb_length = CLOCK_FREQ * p_epg->p_current->i_duration;
- }
- }
-- es_out_Control( p_demux->out, ES_OUT_SET_GROUP_EPG, p_eit->i_service_id, p_epg );
-+ es_out_Control( p_demux->out, ES_OUT_SET_GROUP_EPG, p_eit->i_extension, p_epg );
- }
- vlc_epg_Delete( p_epg );
-
-@@ -4506,7 +4506,8 @@
- {
- PIDInit( pmt, true, pat->psi );
- pmt->psi->prg[pmt->psi->i_prg-1]->handle =
-- dvbpsi_pmt_attach( p_program->i_number,
-+ dvbpsi_new(NULL, 0);
-+ dvbpsi_pmt_attach(pmt->psi->prg[pmt->psi->i_prg-1]->handle, p_program->i_number,
- (dvbpsi_pmt_callback)PMTCallBack,
- p_demux );
- pmt->psi->prg[pmt->psi->i_prg-1]->i_number =
---- modules/mux/mpeg/ts.c.orig 2013-08-09 16:18:12.519503507 +0200
-+++ modules/mux/mpeg/ts.c 2013-08-09 17:30:33.465988000 +0200
-@@ -2341,8 +2341,10 @@
- p_sys->i_pmt_program_number[i],
- p_sys->pmt[i].i_pid );
-
-- p_section = dvbpsi_pat_sections_generate( &pat,
-+ dvbpsi_t *dvbpsi = dvbpsi_new(NULL, 0);
-+ p_section = dvbpsi_pat_sections_generate( dvbpsi, &pat,
- 0 ); /* max program per section */
-+ dvbpsi_delete(dvbpsi);
-
- p_pat = WritePSISection( p_mux->p_sout, p_section );
-
-@@ -2394,7 +2396,7 @@
- }
-
- if( p_sys->b_sdt )
-- dvbpsi_sdt_init( &sdt, p_sys->i_tsid, 1, 1, p_sys->i_netid );
-+ dvbpsi_sdt_init( &sdt, p_sys->i_tsid, 1, 1, false, p_sys->i_netid );
-
- for( i = 0; i < p_sys->i_num_pmt; i++ )
- {
-@@ -2737,9 +2739,10 @@
- }
- }
-
-+ dvbpsi_t *dvbpsi = dvbpsi_new(NULL, 0);
- for( i = 0; i < p_sys->i_num_pmt; i++ )
- {
-- p_section[i] = dvbpsi_pmt_sections_generate( &p_sys->dvbpmt[i] );
-+ p_section[i] = dvbpsi_pmt_sections_generate( dvbpsi, &p_sys->dvbpmt[i] );
- p_pmt[i] = WritePSISection( p_mux->p_sout, p_section[i] );
- PEStoTS( p_mux->p_sout, c, p_pmt[i], &p_sys->pmt[i] );
- dvbpsi_DeletePSISections( p_section[i] );
-@@ -2748,10 +2751,11 @@
-
- if( p_sys->b_sdt )
- {
-- p_section2 = dvbpsi_sdt_sections_generate( &sdt );
-+ p_section2 = dvbpsi_sdt_sections_generate( dvbpsi, &sdt );
- p_sdt = WritePSISection( p_mux->p_sout, p_section2 );
- PEStoTS( p_mux->p_sout, c, p_sdt, &p_sys->sdt );
- dvbpsi_DeletePSISections( p_section2 );
-- dvbpsi_EmptySDT( &sdt );
-+ dvbpsi_sdt_empty( &sdt );
- }
-+ dvbpsi_delete(dvbpsi);
- }