1 Index: modules/access/dtv/en50221.c
2 ===================================================================
3 --- modules/access/dtv/en50221.c.orig
4 +++ modules/access/dtv/en50221.c
5 @@ -2231,13 +2231,13 @@ int en50221_SetCAPMT( cam_t * p_cam, dvb
7 if ( !b_needs_descrambling )
9 - dvbpsi_DeletePMT( p_pmt );
10 + dvbpsi_pmt_delete( p_pmt );
11 p_pmt = p_cam->pp_selected_programs[i];
12 p_cam->pp_selected_programs[i] = NULL;
14 else if( p_pmt != p_cam->pp_selected_programs[i] )
16 - dvbpsi_DeletePMT( p_cam->pp_selected_programs[i] );
17 + dvbpsi_pmt_delete( p_cam->pp_selected_programs[i] );
18 p_cam->pp_selected_programs[i] = p_pmt;
21 @@ -2276,7 +2276,7 @@ int en50221_SetCAPMT( cam_t * p_cam, dvb
23 if ( !b_needs_descrambling )
25 - dvbpsi_DeletePMT( p_pmt );
26 + dvbpsi_pmt_delete( p_pmt );
30 @@ -2651,7 +2651,7 @@ void en50221_End( cam_t * p_cam )
32 if( p_cam->pp_selected_programs[i] != NULL )
34 - dvbpsi_DeletePMT( p_cam->pp_selected_programs[i] );
35 + dvbpsi_pmt_delete( p_cam->pp_selected_programs[i] );
39 Index: modules/demux/ts.c
40 ===================================================================
41 --- modules/demux/ts.c.orig 2013-02-08 13:31:21.000000000 +0100
42 +++ modules/demux/ts.c 2013-07-27 08:34:12.650364561 +0200
47 - dvbpsi_handle handle;
55 /* for special PAT/SDT case */
56 - dvbpsi_handle handle; /* PAT/SDT/EIT */
57 + dvbpsi_t *handle; /* PAT/SDT/EIT */
63 static void PATCallBack( demux_t *, dvbpsi_pat_t * );
64 static void PMTCallBack( demux_t *p_demux, dvbpsi_pmt_t *p_pmt );
65 -static void PSINewTableCallBack( demux_t *, dvbpsi_handle,
66 +static void PSINewTableCallBack( demux_t *, dvbpsi_t *,
67 uint8_t i_table_id, uint16_t i_extension );
68 static int ChangeKeyCallback( vlc_object_t *, char const *, vlc_value_t, vlc_value_t, void * );
71 /* Init PAT handler */
73 PIDInit( pat, true, NULL );
74 - pat->psi->handle = dvbpsi_AttachPAT( (dvbpsi_pat_callback)PATCallBack,
75 + pat->psi->handle = dvbpsi_new(NULL, 0);
76 + dvbpsi_pat_attach( pat->psi->handle, (dvbpsi_pat_callback)PATCallBack,
78 if( p_sys->b_dvb_meta )
81 ts_pid_t *eit = &p_sys->pid[0x12];
83 PIDInit( sdt, true, NULL );
85 - dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
86 + sdt->psi->handle = dvbpsi_new(NULL, 0);
87 + dvbpsi_AttachDemux( sdt->psi->handle, (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
89 PIDInit( eit, true, NULL );
91 - dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
92 + eit->psi->handle = dvbpsi_new(NULL, 0);
93 + dvbpsi_AttachDemux( eit->psi->handle, (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
96 ts_pid_t *tdt = &p_sys->pid[0x14];
97 PIDInit( tdt, true, NULL );
99 - dvbpsi_AttachDemux( (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
100 + tdt->psi->handle = dvbpsi_new(NULL, 0);
101 + dvbpsi_AttachDemux( tdt->psi->handle, (dvbpsi_demux_new_cb_t)PSINewTableCallBack,
104 if( p_sys->b_access_control )
109 - dvbpsi_DetachPAT( pid->psi->handle );
110 + dvbpsi_pat_detach( pid->psi->handle );
114 @@ -1089,13 +1090,13 @@
116 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 ) ) )
118 - dvbpsi_PushPacket( p_pid->psi->handle, p_pkt->p_buffer );
119 + dvbpsi_packet_push( p_pid->psi->handle, p_pkt->p_buffer );
123 for( int i_prg = 0; i_prg < p_pid->psi->i_prg; i_prg++ )
125 - dvbpsi_PushPacket( p_pid->psi->prg[i_prg]->handle,
126 + dvbpsi_packet_push( p_pid->psi->prg[i_prg]->handle,
130 @@ -1372,7 +1373,8 @@
133 prg->i_number = i_number != 0 ? i_number : TS_USER_PMT_NUMBER;
134 - prg->handle = dvbpsi_AttachPMT( i_number != TS_USER_PMT_NUMBER ? i_number : 1, (dvbpsi_pmt_callback)PMTCallBack, p_demux );
135 + prg->handle = dvbpsi_new(NULL, 0);
136 + dvbpsi_pmt_attach( prg->handle, i_number != TS_USER_PMT_NUMBER ? i_number : 1, (dvbpsi_pmt_callback)PMTCallBack, p_demux );
137 TAB_APPEND( pmt->psi->i_prg, pmt->psi->prg, prg );
139 psz = strchr( psz, '=' );
140 @@ -1588,13 +1590,13 @@
143 if( pid->psi->handle )
144 - dvbpsi_DetachPMT( pid->psi->handle );
145 + dvbpsi_pmt_detach( pid->psi->handle );
146 for( int i = 0; i < pid->psi->i_prg; i++ )
148 if( pid->psi->prg[i]->iod )
149 IODFree( pid->psi->prg[i]->iod );
150 if( pid->psi->prg[i]->handle )
151 - dvbpsi_DetachPMT( pid->psi->prg[i]->handle );
152 + dvbpsi_pmt_detach( pid->psi->prg[i]->handle );
153 free( pid->psi->prg[i] );
155 free( pid->psi->prg );
156 @@ -2937,14 +2939,14 @@
157 ( !p_sdt->b_current_next ||
158 p_sdt->i_version == sdt->psi->i_sdt_version ) )
160 - dvbpsi_DeleteSDT( p_sdt );
161 + dvbpsi_sdt_delete( p_sdt );
165 - msg_Dbg( p_demux, "new SDT ts_id=%d version=%d current_next=%d "
166 +/* msg_Dbg( p_demux, "new SDT ts_id=%d version=%d current_next=%d "
168 p_sdt->i_ts_id, p_sdt->i_version, p_sdt->b_current_next,
169 - p_sdt->i_network_id );
170 + p_sdt->i_network_id ); */
172 p_sys->b_broken_charset = false;
174 @@ -3055,7 +3057,7 @@
177 sdt->psi->i_sdt_version = p_sdt->i_version;
178 - dvbpsi_DeleteSDT( p_sdt );
179 + dvbpsi_sdt_delete( p_sdt );
182 /* i_year: year - 1900 i_month: 0-11 i_mday: 1-31 i_hour: 0-23 i_minute: 0-59 i_second: 0-59 */
183 @@ -3125,7 +3127,7 @@
185 p_sys->i_tdt_delta = CLOCK_FREQ * EITConvertStartTime( p_tdt->i_utc_time )
187 - dvbpsi_DeleteTOT(p_tdt);
188 + dvbpsi_tot_delete(p_tdt);
192 @@ -3140,16 +3142,16 @@
193 msg_Dbg( p_demux, "EITCallBack called" );
194 if( !p_eit->b_current_next )
196 - dvbpsi_DeleteEIT( p_eit );
197 + dvbpsi_eit_delete( p_eit );
201 - msg_Dbg( p_demux, "new EIT service_id=%d version=%d current_next=%d "
202 +/* msg_Dbg( p_demux, "new EIT service_id=%d version=%d current_next=%d "
203 "ts_id=%d network_id=%d segment_last_section_number=%d "
205 p_eit->i_service_id, p_eit->i_version, p_eit->b_current_next,
206 p_eit->i_ts_id, p_eit->i_network_id,
207 - p_eit->i_segment_last_section_number, p_eit->i_last_table_id );
208 + p_eit->i_segment_last_section_number, p_eit->i_last_table_id ); */
210 p_epg = vlc_epg_New( NULL );
211 for( p_evt = p_eit->p_first_event; p_evt; p_evt = p_evt->p_next )
212 @@ -3277,7 +3279,7 @@
214 vlc_epg_Delete( p_epg );
216 - dvbpsi_DeleteEIT( p_eit );
217 + dvbpsi_eit_delete( p_eit );
219 static void EITCallBackCurrentFollowing( demux_t *p_demux, dvbpsi_eit_t *p_eit )
221 @@ -3288,7 +3290,7 @@
222 EITCallBack( p_demux, p_eit, false );
225 -static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_handle h,
226 +static void PSINewTableCallBack( demux_t *p_demux, dvbpsi_t *h,
227 uint8_t i_table_id, uint16_t i_extension )
230 @@ -3300,7 +3302,7 @@
231 msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
232 i_table_id, i_table_id, i_extension, i_extension );
234 - dvbpsi_AttachSDT( h, i_table_id, i_extension,
235 + dvbpsi_sdt_attach( h, i_table_id, i_extension,
236 (dvbpsi_sdt_callback)SDTCallBack, p_demux );
238 else if( p_demux->p_sys->pid[0x11].psi->i_sdt_version != -1 &&
239 @@ -3313,7 +3315,7 @@
240 dvbpsi_eit_callback cb = i_table_id == 0x4e ?
241 (dvbpsi_eit_callback)EITCallBackCurrentFollowing :
242 (dvbpsi_eit_callback)EITCallBackSchedule;
243 - dvbpsi_AttachEIT( h, i_table_id, i_extension, cb, p_demux );
244 + dvbpsi_eit_attach( h, i_table_id, i_extension, cb, p_demux );
247 else if( p_demux->p_sys->pid[0x11].psi->i_sdt_version != -1 &&
248 @@ -3321,7 +3323,7 @@
250 msg_Dbg( p_demux, "PSINewTableCallBack: table 0x%x(%d) ext=0x%x(%d)",
251 i_table_id, i_table_id, i_extension, i_extension );
252 - dvbpsi_AttachTOT( h, i_table_id, i_extension,
253 + dvbpsi_tot_attach( h, i_table_id, i_extension,
254 (dvbpsi_tot_callback)TDTCallBack, p_demux);
257 @@ -4118,14 +4120,14 @@
260 msg_Warn( p_demux, "unreferenced program (broken stream)" );
261 - dvbpsi_DeletePMT(p_pmt);
262 + dvbpsi_pmt_delete(p_pmt);
266 if( prg->i_version != -1 &&
267 ( !p_pmt->b_current_next || prg->i_version == p_pmt->i_version ) )
269 - dvbpsi_DeletePMT( p_pmt );
270 + dvbpsi_pmt_delete( p_pmt );
274 @@ -4354,7 +4356,7 @@
275 if( !ProgramIsSelected( p_demux, prg->i_number )
276 || stream_Control( p_demux->s, STREAM_CONTROL_ACCESS,
277 ACCESS_SET_PRIVATE_ID_CA, p_pmt ) != VLC_SUCCESS )
278 - dvbpsi_DeletePMT( p_pmt );
279 + dvbpsi_pmt_delete( p_pmt );
281 for( int i = 0; i < i_clean; i++ )
283 @@ -4382,7 +4384,7 @@
284 p_pat->i_version == pat->psi->i_pat_version ) ) ||
287 - dvbpsi_DeletePAT( p_pat );
288 + dvbpsi_pat_delete( p_pat );
292 @@ -4504,7 +4506,7 @@
294 PIDInit( pmt, true, pat->psi );
295 pmt->psi->prg[pmt->psi->i_prg-1]->handle =
296 - dvbpsi_AttachPMT( p_program->i_number,
297 + dvbpsi_pmt_attach( p_program->i_number,
298 (dvbpsi_pmt_callback)PMTCallBack,
300 pmt->psi->prg[pmt->psi->i_prg-1]->i_number =
301 @@ -4526,5 +4528,5 @@
303 pat->psi->i_pat_version = p_pat->i_version;
305 - dvbpsi_DeletePAT( p_pat );
306 + dvbpsi_pat_delete( p_pat );
308 Index: modules/mux/mpeg/ts.c
309 ===================================================================
310 --- modules/mux/mpeg/ts.c.orig
311 +++ modules/mux/mpeg/ts.c
312 @@ -2333,15 +2333,15 @@ static void GetPAT( sout_mux_t *p_mux,
313 dvbpsi_psi_section_t *p_section;
316 - dvbpsi_InitPAT( &pat, p_sys->i_tsid, p_sys->i_pat_version_number,
317 + dvbpsi_pat_init( &pat, p_sys->i_tsid, p_sys->i_pat_version_number,
318 1 ); /* b_current_next */
319 /* add all programs */
320 for ( i = 0; i < p_sys->i_num_pmt; i++ )
321 - dvbpsi_PATAddProgram( &pat,
322 + dvbpsi_pat_program_add( &pat,
323 p_sys->i_pmt_program_number[i],
324 p_sys->pmt[i].i_pid );
326 - p_section = dvbpsi_GenPATSections( &pat,
327 + p_section = dvbpsi_pat_sections_generate( &pat,
328 0 ); /* max program per section */
330 p_pat = WritePSISection( p_mux->p_sout, p_section );
331 @@ -2349,7 +2349,7 @@ static void GetPAT( sout_mux_t *p_mux,
332 PEStoTS( p_mux->p_sout, c, p_pat, &p_sys->pat );
334 dvbpsi_DeletePSISections( p_section );
335 - dvbpsi_EmptyPAT( &pat );
336 + dvbpsi_pat_empty( &pat );
339 static uint32_t GetDescriptorLength24b( int i_length )
340 @@ -2394,11 +2394,11 @@ static void GetPMT( sout_mux_t *p_mux, s
344 - dvbpsi_InitSDT( &sdt, p_sys->i_tsid, 1, 1, p_sys->i_netid );
345 + dvbpsi_sdt_init( &sdt, p_sys->i_tsid, 1, 1, p_sys->i_netid );
347 for( i = 0; i < p_sys->i_num_pmt; i++ )
349 - dvbpsi_InitPMT( &p_sys->dvbpmt[i],
350 + dvbpsi_pmt_init( &p_sys->dvbpmt[i],
351 p_sys->i_pmt_program_number[i], /* program number */
352 p_sys->i_pmt_version_number,
353 1, /* b_current_next */
354 @@ -2406,7 +2406,7 @@ static void GetPMT( sout_mux_t *p_mux, s
358 - p_service = dvbpsi_SDTAddService( &sdt,
359 + p_service = dvbpsi_sdt_service_add( &sdt,
360 p_sys->i_pmt_program_number[i], /* service id */
361 0, /* eit schedule */
363 @@ -2435,7 +2435,7 @@ static void GetPMT( sout_mux_t *p_mux, s
364 memcpy( &psz_sdt_desc[3+strlen(psz_sdtprov)], psz_sdtserv,
365 strlen(psz_sdtserv) );
367 - dvbpsi_SDTServiceAddDescriptor( p_service, 0x48,
368 + dvbpsi_sdt_service_descriptor_add( p_service, 0x48,
369 3 + strlen(psz_sdtprov) + strlen(psz_sdtserv),
370 (uint8_t *)psz_sdt_desc );
371 free( psz_sdt_desc );
372 @@ -2590,13 +2590,13 @@ static void GetPMT( sout_mux_t *p_mux, s
373 p_usepid = bsearch( &p_usepid, p_sys->pmtmap, p_sys->i_num_pmt,
374 sizeof(pmt_map_t), pmtcompare );
375 if( p_usepid != NULL )
376 - dvbpsi_PMTAddDescriptor(
377 + dvbpsi_pmt_descriptor_add(
378 &p_sys->dvbpmt[((pmt_map_t *)p_usepid)->i_prog], 0x1d,
379 bits.i_data, bits.p_data );
381 msg_Err( p_mux, "Received an unmapped PID" );
383 - dvbpsi_PMTAddDescriptor( &p_sys->dvbpmt[0], 0x1d, bits.i_data,
384 + dvbpsi_pmt_descriptor_add( &p_sys->dvbpmt[0], 0x1d, bits.i_data,
388 @@ -2612,12 +2612,12 @@ static void GetPMT( sout_mux_t *p_mux, s
389 sizeof(pmt_map_t), intcompare );
391 if( p_usepid != NULL )
392 - p_es = dvbpsi_PMTAddES(
393 + p_es = dvbpsi_pmt_es_add(
394 &p_sys->dvbpmt[((pmt_map_t *)p_usepid)->i_prog],
395 p_stream->i_stream_type, p_stream->i_pid );
397 /* If there's an error somewhere, dump it to the first pmt */
398 - p_es = dvbpsi_PMTAddES( &p_sys->dvbpmt[0], p_stream->i_stream_type,
399 + p_es = dvbpsi_pmt_es_add( &p_sys->dvbpmt[0], p_stream->i_stream_type,
402 if( p_stream->i_stream_id == 0xfa || p_stream->i_stream_id == 0xfb )
403 @@ -2627,7 +2627,7 @@ static void GetPMT( sout_mux_t *p_mux, s
405 es_id[0] = (p_stream->i_es_id >> 8)&0xff;
406 es_id[1] = (p_stream->i_es_id)&0xff;
407 - dvbpsi_PMTESAddDescriptor( p_es, 0x1f, 2, es_id );
408 + dvbpsi_pmt_es_descriptor_add( p_es, 0x1f, 2, es_id );
410 else if( p_stream->i_stream_type == 0xa0 )
412 @@ -2648,21 +2648,21 @@ static void GetPMT( sout_mux_t *p_mux, s
415 /* 0xa0 is private */
416 - dvbpsi_PMTESAddDescriptor( p_es, 0xa0, i_extra + 10, data );
417 + dvbpsi_pmt_es_descriptor_add( p_es, 0xa0, i_extra + 10, data );
419 else if( p_stream->i_stream_type == 0x81 )
421 uint8_t format[4] = { 0x41, 0x43, 0x2d, 0x33 };
423 /* "registration" descriptor : "AC-3" */
424 - dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, format );
425 + dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, format );
427 else if( p_stream->i_codec == VLC_CODEC_DIRAC )
429 /* Dirac registration descriptor */
431 uint8_t data[4] = { 'd', 'r', 'a', 'c' };
432 - dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
433 + dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
435 else if( p_stream->i_codec == VLC_CODEC_DTS )
437 @@ -2670,18 +2670,18 @@ static void GetPMT( sout_mux_t *p_mux, s
439 /* DTS format identifier, frame size 1024 - FIXME */
440 uint8_t data[4] = { 0x44, 0x54, 0x53, 0x32 };
441 - dvbpsi_PMTESAddDescriptor( p_es, 0x05, 4, data );
442 + dvbpsi_pmt_es_descriptor_add( p_es, 0x05, 4, data );
444 else if( p_stream->i_codec == VLC_CODEC_EAC3 )
446 uint8_t data[1] = { 0x00 };
447 - dvbpsi_PMTESAddDescriptor( p_es, 0x7a, 1, data );
448 + dvbpsi_pmt_es_descriptor_add( p_es, 0x7a, 1, data );
450 else if( p_stream->i_codec == VLC_CODEC_TELETEXT )
452 if( p_stream->i_decoder_specific_info )
454 - dvbpsi_PMTESAddDescriptor( p_es, 0x56,
455 + dvbpsi_pmt_es_descriptor_add( p_es, 0x56,
456 p_stream->i_decoder_specific_info,
457 p_stream->p_decoder_specific_info );
459 @@ -2693,7 +2693,7 @@ static void GetPMT( sout_mux_t *p_mux, s
460 if( p_stream->i_decoder_specific_info )
462 /* pass-through from the TS demux */
463 - dvbpsi_PMTESAddDescriptor( p_es, 0x59,
464 + dvbpsi_pmt_es_descriptor_add( p_es, 0x59,
465 p_stream->i_decoder_specific_info,
466 p_stream->p_decoder_specific_info );
468 @@ -2714,7 +2714,7 @@ static void GetPMT( sout_mux_t *p_mux, s
470 p_descr = dvbpsi_GenSubtitlingDr( &descr, 0 );
471 /* Work around bug in old libdvbpsi */ p_descr->i_length = 8;
472 - dvbpsi_PMTESAddDescriptor( p_es, p_descr->i_tag,
473 + dvbpsi_pmt_es_descriptor_add( p_es, p_descr->i_tag,
474 p_descr->i_length, p_descr->p_data );
477 @@ -2733,22 +2733,22 @@ static void GetPMT( sout_mux_t *p_mux, s
478 data[i*4+2] = p_stream->lang[i*3+2];
479 data[i*4+3] = 0x00; /* audio type: 0x00 undefined */
481 - dvbpsi_PMTESAddDescriptor( p_es, 0x0a, 4*p_stream->i_langs, data );
482 + dvbpsi_pmt_es_descriptor_add( p_es, 0x0a, 4*p_stream->i_langs, data );
486 for( i = 0; i < p_sys->i_num_pmt; i++ )
488 - p_section[i] = dvbpsi_GenPMTSections( &p_sys->dvbpmt[i] );
489 + p_section[i] = dvbpsi_pmt_sections_generate( &p_sys->dvbpmt[i] );
490 p_pmt[i] = WritePSISection( p_mux->p_sout, p_section[i] );
491 PEStoTS( p_mux->p_sout, c, p_pmt[i], &p_sys->pmt[i] );
492 dvbpsi_DeletePSISections( p_section[i] );
493 - dvbpsi_EmptyPMT( &p_sys->dvbpmt[i] );
494 + dvbpsi_pmt_empty( &p_sys->dvbpmt[i] );
499 - p_section2 = dvbpsi_GenSDTSections( &sdt );
500 + p_section2 = dvbpsi_sdt_sections_generate( &sdt );
501 p_sdt = WritePSISection( p_mux->p_sout, p_section2 );
502 PEStoTS( p_mux->p_sout, c, p_sdt, &p_sys->sdt );
503 dvbpsi_DeletePSISections( p_section2 );
504 --- modules/demux/ts.c.orig 2013-08-08 19:38:57.049290576 +0200
505 +++ modules/demux/ts.c 2013-08-09 16:06:44.526199046 +0200
506 @@ -3264,7 +3264,7 @@
508 if( b_current_following &&
509 ( p_sys->i_current_program == -1 ||
510 - p_sys->i_current_program == p_eit->i_service_id ) )
511 + p_sys->i_current_program == p_eit->i_extension ) )
513 p_sys->i_dvb_length = 0;
514 p_sys->i_dvb_start = 0;
515 @@ -3275,7 +3275,7 @@
516 p_sys->i_dvb_length = CLOCK_FREQ * p_epg->p_current->i_duration;
519 - es_out_Control( p_demux->out, ES_OUT_SET_GROUP_EPG, p_eit->i_service_id, p_epg );
520 + es_out_Control( p_demux->out, ES_OUT_SET_GROUP_EPG, p_eit->i_extension, p_epg );
522 vlc_epg_Delete( p_epg );
524 @@ -4506,7 +4506,8 @@
526 PIDInit( pmt, true, pat->psi );
527 pmt->psi->prg[pmt->psi->i_prg-1]->handle =
528 - dvbpsi_pmt_attach( p_program->i_number,
529 + dvbpsi_new(NULL, 0);
530 + dvbpsi_pmt_attach(pmt->psi->prg[pmt->psi->i_prg-1]->handle, p_program->i_number,
531 (dvbpsi_pmt_callback)PMTCallBack,
533 pmt->psi->prg[pmt->psi->i_prg-1]->i_number =
534 --- modules/mux/mpeg/ts.c.orig 2013-08-09 16:18:12.519503507 +0200
535 +++ modules/mux/mpeg/ts.c 2013-08-09 17:30:33.465988000 +0200
536 @@ -2341,8 +2341,10 @@
537 p_sys->i_pmt_program_number[i],
538 p_sys->pmt[i].i_pid );
540 - p_section = dvbpsi_pat_sections_generate( &pat,
541 + dvbpsi_t *dvbpsi = dvbpsi_new(NULL, 0);
542 + p_section = dvbpsi_pat_sections_generate( dvbpsi, &pat,
543 0 ); /* max program per section */
544 + dvbpsi_delete(dvbpsi);
546 p_pat = WritePSISection( p_mux->p_sout, p_section );
548 @@ -2394,7 +2396,7 @@
552 - dvbpsi_sdt_init( &sdt, p_sys->i_tsid, 1, 1, p_sys->i_netid );
553 + dvbpsi_sdt_init( &sdt, p_sys->i_tsid, 1, 1, false, p_sys->i_netid );
555 for( i = 0; i < p_sys->i_num_pmt; i++ )
557 @@ -2737,9 +2739,10 @@
561 + dvbpsi_t *dvbpsi = dvbpsi_new(NULL, 0);
562 for( i = 0; i < p_sys->i_num_pmt; i++ )
564 - p_section[i] = dvbpsi_pmt_sections_generate( &p_sys->dvbpmt[i] );
565 + p_section[i] = dvbpsi_pmt_sections_generate( dvbpsi, &p_sys->dvbpmt[i] );
566 p_pmt[i] = WritePSISection( p_mux->p_sout, p_section[i] );
567 PEStoTS( p_mux->p_sout, c, p_pmt[i], &p_sys->pmt[i] );
568 dvbpsi_DeletePSISections( p_section[i] );
569 @@ -2748,10 +2751,11 @@
573 - p_section2 = dvbpsi_sdt_sections_generate( &sdt );
574 + p_section2 = dvbpsi_sdt_sections_generate( dvbpsi, &sdt );
575 p_sdt = WritePSISection( p_mux->p_sout, p_section2 );
576 PEStoTS( p_mux->p_sout, c, p_sdt, &p_sys->sdt );
577 dvbpsi_DeletePSISections( p_section2 );
578 - dvbpsi_EmptySDT( &sdt );
579 + dvbpsi_sdt_empty( &sdt );
581 + dvbpsi_delete(dvbpsi);