p_sys->p_sessions[i_session_id - 1].pf_handle = ConditionalAccessHandle;
p_sys->p_sessions[i_session_id - 1].pf_close = ConditionalAccessClose;
- p_sys->p_sessions[i_session_id - 1].p_sys = malloc(sizeof(system_ids_t));
- memset( p_sys->p_sessions[i_session_id - 1].p_sys, 0,
- sizeof(system_ids_t) );
+ p_sys->p_sessions[i_session_id - 1].p_sys = calloc( 1, sizeof(system_ids_t) );
APDUSend( p_access, i_session_id, AOT_CA_INFO_ENQ, NULL, 0 );
}
p_sys->p_sessions[i_session_id - 1].pf_handle = DateTimeHandle;
p_sys->p_sessions[i_session_id - 1].pf_manage = DateTimeManage;
p_sys->p_sessions[i_session_id - 1].pf_close = DateTimeClose;
- p_sys->p_sessions[i_session_id - 1].p_sys = malloc(sizeof(date_time_t));
- memset( p_sys->p_sessions[i_session_id - 1].p_sys, 0, sizeof(date_time_t) );
+ p_sys->p_sessions[i_session_id - 1].p_sys = calloc( 1, sizeof(date_time_t) );
DateTimeSend( p_access, i_session_id );
}
access->pf_control = Control;
access->info = src->info;
- access_sys_t *p_sys = access->p_sys = malloc (sizeof (*p_sys));
- if (p_sys == NULL)
+ access_sys_t *p_sys = access->p_sys = calloc( 1, sizeof (*p_sys) );
+ if( !p_sys )
return VLC_ENOMEM;
- memset (p_sys, 0, sizeof (*p_sys));
p_sys->bandwidth = var_CreateGetInteger (access, "access-bandwidth");
p_sys->last_time = mdate ();
access->info = src->info;
return ret;
}
+
access->pf_control = Control;
access->info = src->info;
- access_sys_t *p_sys = access->p_sys = malloc (sizeof (*p_sys));
- if (p_sys == NULL)
+ access_sys_t *p_sys = access->p_sys = calloc( 1, sizeof (*p_sys) );
+ if( !p_sys )
return VLC_ENOMEM;
- memset (p_sys, 0, sizeof (*p_sys));
# ifndef UNDER_CE
if ((p_sys->stream = tmpfile ()) == NULL)
const char *psz_name, int i_port, char *psz_txt )
{
int err;
- bonjour_t *p_sys;
- p_sys = (bonjour_t *)malloc( sizeof(*p_sys) );
+ bonjour_t* p_sys = calloc( 1, sizeof(*p_sys) );
if( p_sys == NULL )
return NULL;
- memset( p_sys, 0, sizeof(*p_sys) );
-
p_sys->p_log = p_log;
-
p_sys->i_port = i_port;
p_sys->psz_name = avahi_strdup( psz_name );
p_sys->psz_stype = avahi_strdup( psz_stype );
struct pa_channel_map map;
/* Allocate structures */
- p_aout->output.p_sys = p_sys = malloc( sizeof( aout_sys_t ) );
+ p_aout->output.p_sys = p_sys = calloc( 1, sizeof( aout_sys_t ) );
if( p_sys == NULL )
return VLC_ENOMEM;
- memset( p_sys, 0, sizeof( aout_sys_t ) );
PULSE_DEBUG( "Pulse start initialization");
}
/* Allocate the memory needed to store the encoder's structure */
- if( ( p_sys = (encoder_sys_t *)malloc(sizeof(encoder_sys_t)) ) == NULL )
+ if( ( p_sys = calloc( 1, sizeof(encoder_sys_t) ) ) == NULL )
return VLC_ENOMEM;
- memset( p_sys, 0, sizeof(encoder_sys_t) );
p_enc->p_sys = p_sys;
p_sys->p_codec = p_codec;
vlc_value_t val;
/* Allocate the memory needed to store the decoder's structure */
- if( ( p_dec->p_sys = p_sys =
- (decoder_sys_t *)malloc(sizeof(decoder_sys_t)) ) == NULL )
- {
+ if( ( p_dec->p_sys = p_sys = calloc( 1, sizeof(decoder_sys_t) ) ) == NULL )
return VLC_ENOMEM;
- }
- memset( p_sys, 0, sizeof(decoder_sys_t) );
p_dec->p_sys->p_context = p_context;
p_dec->p_sys->p_codec = p_codec;
p_dec->pf_decode_sub = Decode;
/* Allocate the memory needed to store the decoder's structure */
- p_dec->p_sys = p_sys = malloc( sizeof( *p_sys ) );
+ p_dec->p_sys = p_sys = calloc( 1, sizeof( *p_sys ) );
if( p_sys == NULL )
return VLC_ENOMEM;
/* init of p_sys */
- memset( p_sys, 0, sizeof( *p_sys ) );
- p_sys->i_block = 0;
-
p_sys->i_field = i_field;
p_sys->i_channel = i_channel;
return VLC_EGENERIC;
/* Allocate the memory needed to store the decoder's structure */
- p_dec->p_sys = p_sys = malloc(sizeof(decoder_sys_t));
+ p_dec->p_sys = p_sys = calloc( 1, sizeof(decoder_sys_t) );
if( !p_sys )
return VLC_ENOMEM;
/* Init */
- memset( p_sys, 0, sizeof(*p_sys) );
- p_sys->i_offseth = 0;
- p_sys->i_offsetv = 0;
p_sys->p_screen = p_sys->screen;
/* Set output properties
p_dec->pf_decode_sub = DecodeBlock;
- p_dec->p_sys = p_sys = malloc( sizeof( decoder_sys_t ) );
+ p_dec->p_sys = p_sys = calloc( 1, sizeof( decoder_sys_t ) );
if( !p_sys )
return VLC_ENOMEM;
- memset( &p_sys->fmt_cached, 0, sizeof( p_sys->fmt_cached ) );
p_sys->p_stream_ext = p_stream_ext;
p_sys->pf_push_packet = p_stream_ext->push_packet;
static vod_media_t *MediaNew( vod_t *p_vod, const char *psz_name,
input_item_t *p_item )
{
- vod_sys_t *p_sys = p_vod->p_sys;
- vod_media_t *p_media = malloc( sizeof(vod_media_t) );
int i;
+ vod_sys_t *p_sys = p_vod->p_sys;
+ vod_media_t *p_media = calloc( 1, sizeof(vod_media_t) );
if( !p_media )
return NULL;
- memset( p_media, 0, sizeof(vod_media_t) );
p_media->id = p_sys->i_media_id++;
TAB_INIT( p_media->i_es, p_media->es );
p_media->psz_mux = NULL;
static int MediaAddES( vod_t *p_vod, vod_media_t *p_media, es_format_t *p_fmt )
{
- media_es_t *p_es = malloc( sizeof(media_es_t) );
char *psz_urlc;
-
- if( !p_es ) return VLC_ENOMEM;
- memset( p_es, 0, sizeof(media_es_t) );
+ media_es_t *p_es = calloc( 1, sizeof(media_es_t) );
+ if( !p_es )
+ return VLC_ENOMEM;
free( p_media->psz_mux );
p_media->psz_mux = NULL;
****************************************************************************/
static rtsp_client_t *RtspClientNew( vod_media_t *p_media, char *psz_session )
{
- rtsp_client_t *p_rtsp = malloc( sizeof(rtsp_client_t) );
+ rtsp_client_t *p_rtsp = calloc( 1, sizeof(rtsp_client_t) );
- if( !p_rtsp ) return NULL;
- memset( p_rtsp, 0, sizeof(rtsp_client_t) );
+ if( !p_rtsp )
+ return NULL;
p_rtsp->es = 0;
p_rtsp->psz_session = psz_session;
*****************************************************************************/
csa_t *csa_New( void )
{
- csa_t *c = malloc( sizeof( csa_t ) );
- memset( c, 0, sizeof( csa_t ) );
-
- return c;
+ return calloc( 1, sizeof( csa_t ) );
}
/*****************************************************************************
* csa_Delete:
*****************************************************************************/
-void csa_Delete( csa_t *c )
+void csa_Delete( csa_t *c )
{
free( c );
}
case VLC_FOURCC( 'W', 'M', 'V', '2' ):
case VLC_FOURCC( 'W', 'M', 'V', '3' ):
case VLC_FOURCC( 'S', 'N', 'O', 'W' ):
- p_stream->p_oggds_header = malloc( sizeof(oggds_header_t) );
+ p_stream->p_oggds_header = calloc( 1, sizeof(oggds_header_t) );
if( !p_stream->p_oggds_header )
{
free( p_stream );
return VLC_ENOMEM;
}
- memset( p_stream->p_oggds_header, 0, sizeof(oggds_header_t) );
p_stream->p_oggds_header->i_packet_type = PACKET_TYPE_HEADER;
memcpy( p_stream->p_oggds_header->stream_type, "video", 5 );
switch( p_stream->i_fourcc )
{
case VLC_FOURCC( 's', 'u','b', 't' ):
- p_stream->p_oggds_header = malloc( sizeof(oggds_header_t) );
+ p_stream->p_oggds_header = calloc( 1, sizeof(oggds_header_t) );
if( !p_stream->p_oggds_header )
{
free( p_stream );
return VLC_ENOMEM;
}
- memset( p_stream->p_oggds_header, 0, sizeof(oggds_header_t) );
p_stream->p_oggds_header->i_packet_type = PACKET_TYPE_HEADER;
memcpy( p_stream->p_oggds_header->stream_type, "text", 4 );
sout_stream_sys_t *p_sys = p_stream->p_sys;
sout_stream_id_t *id;
- id = malloc( sizeof( sout_stream_id_t ) );
+ id = calloc( 1, sizeof( sout_stream_id_t ) );
if( !id )
goto error;
- memset( id, 0, sizeof(sout_stream_id_t) );
id->id = NULL;
id->p_decoder = NULL;