/* */
int i_current_program;
- vlc_list_t *p_programs_list;
+ vlc_list_t programs_list;
/* TS dump */
char *psz_file; /* file to dump data in */
p_sys->b_dvb_meta = true;
p_sys->b_access_control = true;
p_sys->i_current_program = 0;
+ p_sys->programs_list.i_count = 0;
+ p_sys->programs_list.p_values = NULL;
p_sys->i_tdt_delta = 0;
p_sys->i_dvb_start = 0;
p_sys->i_dvb_length = 0;
TAB_CLEAN( p_sys->i_pmt, p_sys->pmt );
- if( p_sys->p_programs_list )
- {
- vlc_value_t val;
- val.p_list = p_sys->p_programs_list;
- var_FreeList( &val, NULL );
- }
+ free( p_sys->programs_list.p_values );
/* If in dump mode, then close the file */
if( p_sys->b_file_out )
else
{
p_sys->i_current_program = -1;
- p_sys->p_programs_list = p_list;
+ p_sys->programs_list.i_count = 0;
+ if( p_list )
+ {
+ vlc_list_t *p_dst = &p_sys->programs_list;
+ free( p_dst->p_values );
+
+ p_dst->p_values = calloc( p_list->i_count,
+ sizeof(*p_dst->p_values) );
+ if( p_dst->p_values )
+ {
+ p_dst->i_count = p_list->i_count;
+ for( int i = 0; i < p_list->i_count; i++ )
+ p_dst->p_values[i] = p_list->p_values[i];
+ }
+ }
}
return VLC_SUCCESS;
}
if( !p_sys->b_access_control )
return false;
- if( ( p_sys->i_current_program == -1 && p_sys->p_programs_list == NULL ) ||
+ if( ( p_sys->i_current_program == -1 && p_sys->programs_list.i_count == 0 ) ||
p_sys->i_current_program == 0 )
return true;
if( p_sys->i_current_program == i_pgrm )
return true;
- if( p_sys->p_programs_list != NULL )
+ if( p_sys->programs_list.i_count != 0 )
{
- for( int i = 0; i < p_sys->p_programs_list->i_count; i++ )
+ for( int i = 0; i < p_sys->programs_list.i_count; i++ )
{
- if( i_pgrm == p_sys->p_programs_list->p_values[i].i_int )
+ if( i_pgrm == p_sys->programs_list.p_values[i].i_int )
return true;
}
}