psz_parser = psz_next;
}
}
- if( psz_filters ) free( psz_filters );
- if( psz_visual ) free( psz_visual );
+ free( psz_filters );
+ free( psz_visual );
/* complete the filter chain if necessary */
if ( !AOUT_FMTS_IDENTICAL( &chain_input_format, &chain_output_format ) )
void libvlc_vlm_set_output( libvlc_instance_t *p_instance, char *psz_name,
char *psz_output, libvlc_exception_t *p_exception )
{
-#define VLM_CHANGE_CODE { if( p_media->psz_output ) free( p_media->psz_output ); \
+#define VLM_CHANGE_CODE { free( p_media->psz_output ); \
p_media->psz_output = strdup( psz_output ); }
VLM_CHANGE( "Unable to change %s output property", VLM_CHANGE_CODE );
#undef VLM_CHANGE_CODE
free( p_media->ppsz_input[--p_media->i_input] ); \
if( psz_input ) \
TAB_APPEND( p_media->i_input, p_media->ppsz_input, strdup(psz_input) ); \
- if( p_media->psz_output ) \
- free( p_media->psz_output ); \
+ free( p_media->psz_output ); \
p_media->psz_output = psz_output ? strdup( psz_output ) : NULL; \
while( p_media->i_option > 0 ) \
free( p_media->ppsz_option[--p_media->i_option] ); \
config_LoadCmdLine( p_libvlc, &i_argc, ppsz_argv, VLC_TRUE );
libvlc_global.p_module_bank->b_cache_delete = b_cache_delete;
}
- if( psz_language ) free( psz_language );
+ free( psz_language );
# endif
#endif
/* Add service discovery modules */
playlist_ServicesDiscoveryAdd( p_playlist, psz_modules );
}
- if( psz_modules ) free( psz_modules );
+ free( psz_modules );
/*
* Load background interfaces
if( psz_morecodecs )
{
config_PutPsz( p_libvlc, "codec", psz_morecodecs);
- free(psz_morecodecs);
+ free( psz_morecodecs );
}
}
else
config_PutPsz( p_libvlc, "codec", "dmo,quicktime");
- free(psz_codecs);
+ free( psz_codecs );
}
#endif
VLC_AddTarget( p_libvlc->i_object_id, val.psz_string, NULL, 0,
PLAYLIST_INSERT, 0 );
}
- if ( val.psz_string != NULL ) free( val.psz_string );
+ free( val.psz_string );
return VLC_SUCCESS;
}
psz_pidfile );
}
}
- free ( psz_pidfile );
+ free( psz_pidfile );
}
#endif
* We prefer the dummy interface if none is specified. */
char *psz_interface = config_GetPsz( p_libvlc, "intf" );
if( !psz_interface || !*psz_interface ) psz_module = "dummy";
- if( psz_interface ) free( psz_interface );
+ free( psz_interface );
}
#endif
int httpd_StreamHeader( httpd_stream_t *stream, uint8_t *p_data, int i_data )
{
vlc_mutex_lock( &stream->lock );
- if( stream->p_header )
- {
- free( stream->p_header );
- stream->p_header = NULL;
- }
+ free( stream->p_header );
+ stream->p_header = NULL;
+
stream->i_header = i_data;
if( i_data > 0 )
{
{
httpd_UrlDelete( stream->url );
vlc_mutex_destroy( &stream->lock );
- if( stream->psz_mime ) free( stream->psz_mime );
- if( stream->p_header ) free( stream->p_header );
- if( stream->p_buffer ) free( stream->p_buffer );
+ free( stream->psz_mime );
+ free( stream->p_header );
+ free( stream->p_buffer );
free( stream );
}
httpd = (httpd_t *)vlc_custom_create( p_this, sizeof (*httpd),
VLC_OBJECT_HTTPD,
psz_object_type );
- if (httpd == NULL)
+ if( httpd == NULL )
{
vlc_mutex_unlock( lockval.p_address );
free( psz_host );
{
int i;
- if( msg->psz_url )
- {
- free( msg->psz_url );
- }
- if( msg->psz_args )
- {
- free( msg->psz_args );
- }
+ free( msg->psz_url );
+ free( msg->psz_args );
for( i = 0; i < msg->i_name; i++ )
{
free( msg->name[i] );
free( msg->value[i] );
}
- if( msg->name )
- {
- free( msg->name );
- }
- if( msg->value )
- {
- free( msg->value );
- }
- if( msg->p_body )
- {
- free( msg->p_body );
- }
+ free( msg->name );
+ free( msg->value );
+ free( msg->p_body );
httpd_MsgInit( msg );
}
httpd_MsgClean( &cl->answer );
httpd_MsgClean( &cl->query );
- if( cl->p_buffer )
- {
- free( cl->p_buffer );
- cl->p_buffer = NULL;
- }
+ free( cl->p_buffer );
+ cl->p_buffer = NULL;
}
static httpd_client_t *httpd_ClientNew( int fd, tls_session_t *p_tls, mtime_t now )
psz_next = config_ChainCreate( &p_access->psz_access, &p_access->p_cfg,
psz_access );
- if( psz_next )
- {
- free( psz_next );
- }
+ free( psz_next );
p_access->psz_path = strdup( psz_name ? psz_name : "" );
p_access->p_sout = p_sout;
p_access->p_sys = NULL;
p_mux->p_sout = p_sout;
psz_next = config_ChainCreate( &p_mux->psz_mux, &p_mux->p_cfg, psz_mux );
- if( psz_next ) free( psz_next );
+ free( psz_next );
p_mux->p_access = p_access;
p_mux->pf_control = NULL;
TAB_APPEND( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
if( p_mux->pf_addstream( p_mux, p_input ) < 0 )
{
- msg_Err( p_mux, "cannot add this stream" );
- TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
- block_FifoRelease( p_input->p_fifo );
- free( p_input );
- return NULL;
+ msg_Err( p_mux, "cannot add this stream" );
+ TAB_REMOVE( p_mux->i_nb_inputs, p_mux->pp_inputs, p_input );
+ block_FifoRelease( p_input->p_fifo );
+ free( p_input );
+ return NULL;
}
return p_input;
var_Get( p_vout, "vout-filter", &val );
psz_filter_chain = val.psz_string;
- if( psz_filter_chain && !*psz_filter_chain )
+ if( !*psz_filter_chain )
{
free( psz_filter_chain );
psz_filter_chain = NULL;
}
- if( p_vout->psz_filter_chain && !*p_vout->psz_filter_chain )
+ if( !*p_vout->psz_filter_chain )
{
free( p_vout->psz_filter_chain );
p_vout->psz_filter_chain = NULL;
p_vout->b_filter_change = VLC_FALSE;
}
- if( psz_filter_chain ) free( psz_filter_chain );
+ free( psz_filter_chain );
}
if( ( p_vout->fmt_render.i_width != p_fmt->i_width ) ||
if( var_Get( p_vout, "deinterlace-mode", &val ) == VLC_SUCCESS )
{
var_Set( p_vout, "deinterlace", val );
- if( val.psz_string ) free( val.psz_string );
+ free( val.psz_string );
}
var_AddCallback( p_vout, "deinterlace", DeinterlaceCallback, NULL );
var_Destroy( p_vout, "intf-change" );
- if( p_vout->psz_filter_chain ) free( p_vout->psz_filter_chain );
+ free( p_vout->psz_filter_chain );
config_ChainDestroy( p_vout->p_cfg );
val.psz_string = psz_filter;
var_Set( p_vout, "vout-filter", val );
- if( psz_filter ) free( psz_filter );
+ free( psz_filter );
return VLC_SUCCESS;
}
struct config_chain_t *p_cfg =
p_vout->p_vfilters_cfg[p_vout->i_vfilters_cfg];
config_ChainDestroy( p_cfg );
- if( p_vout->psz_vfilters[p_vout->i_vfilters_cfg] )
- {
- free( p_vout->psz_vfilters[p_vout->i_vfilters_cfg] );
- p_vout->psz_vfilters[p_vout->i_vfilters_cfg] = NULL;
- }
+ free( p_vout->psz_vfilters[p_vout->i_vfilters_cfg] );
+ p_vout->psz_vfilters[p_vout->i_vfilters_cfg] = NULL;
}
p_vout->i_vfilters_cfg = 0;
if( psz_vfilters && *psz_vfilters )
var_Get( p_vout, "crop", &old_val );
if( old_val.psz_string && *old_val.psz_string )
var_Change( p_vout, "crop", VLC_VAR_TRIGGER_CALLBACKS, 0, 0 );
- if( old_val.psz_string ) free( old_val.psz_string );
+ free( old_val.psz_string );
/* Monitor pixel aspect-ratio */
var_Create( p_vout, "monitor-par", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
p_vout->i_par_num, p_vout->i_par_den );
b_force_par = VLC_TRUE;
}
- if( val.psz_string ) free( val.psz_string );
+ free( val.psz_string );
/* Aspect-ratio object var */
var_Create( p_vout, "aspect-ratio", VLC_VAR_STRING | VLC_VAR_ISCOMMAND |
var_Get( p_vout, "aspect-ratio", &old_val );
if( (old_val.psz_string && *old_val.psz_string) || b_force_par )
var_Change( p_vout, "aspect-ratio", VLC_VAR_TRIGGER_CALLBACKS, 0, 0 );
- if( old_val.psz_string ) free( old_val.psz_string );
+ free( old_val.psz_string );
/* Initialize the dimensions of the video window */
InitWindowSize( p_vout, &p_vout->i_window_width,
memset( &fmt_out, 0, sizeof(video_format_t) );
var_Get( p_vout, "snapshot-path", &val );
- if( val.psz_string && !*val.psz_string )
+ if( !*val.psz_string )
{
free( val.psz_string );
val.psz_string = 0;
var_Get( p_vout, "snapshot-format", &format );
if( !format.psz_string || !*format.psz_string )
{
- if( format.psz_string ) free( format.psz_string );
+ free( format.psz_string );
format.psz_string = strdup( "png" );
}
free( psz_name );
}
- if( val.psz_string ) free( val.psz_string );
+ free( val.psz_string );
return VLC_SUCCESS;
}
*/
static void RegionPictureRelease( picture_t *p_pic )
{
- if( p_pic->p_data_orig ) free( p_pic->p_data_orig );
+ free( p_pic->p_data_orig );
}
subpicture_region_t *__spu_CreateRegion( vlc_object_t *p_this,
video_format_t *p_fmt )
if( !p_region->picture.i_planes )
{
free( p_region );
- if( p_fmt->p_palette ) free( p_fmt->p_palette );
+ free( p_fmt->p_palette );
return NULL;
}
if( !p_region ) return;
if( p_region->picture.pf_release )
p_region->picture.pf_release( &p_region->picture );
- if( p_region->fmt.p_palette ) free( p_region->fmt.p_palette );
+ free( p_region->fmt.p_palette );
if( p_region->p_cache ) __spu_DestroyRegion( p_this, p_region->p_cache );
- if( p_region->psz_text )
- free( p_region->psz_text );
- if( p_region->psz_html )
- free( p_region->psz_html );
+ free( p_region->psz_text );
+ free( p_region->psz_html );
//free( p_region->p_style ); FIXME --fenrir plugin does not allocate the memory for it. I think it might lead to segfault, video renderer can live longer than the decoder
free( p_region );
}
p_spu->p_text->p_module =
module_Need( p_spu->p_text, "text renderer", 0, 0 );
}
- if( psz_modulename ) free( psz_modulename );
+ free( psz_modulename );
}
if( p_spu->p_text )
(void)p_filter;
if( p_pic )
{
- if( p_pic->p_data_orig ) free( p_pic->p_data_orig );
+ free( p_pic->p_data_orig );
free( p_pic );
}
}