}
/* free old string */
- if( oldval.psz_string ) free( oldval.psz_string );
+ free( oldval.psz_string );
}
/*****************************************************************************
msg_Dbg( p_input, "selected audio language[%d] %s",
i, p_sys->ppsz_audio_language[i] );
}
- if( val.psz_string ) free( val.psz_string );
+ free( val.psz_string );
var_Get( p_input, "sub-language", &val );
p_sys->ppsz_sub_language = LanguageSplit(val.psz_string);
msg_Dbg( p_input, "selected subtitle language[%d] %s",
i, p_sys->ppsz_sub_language[i] );
}
- if( val.psz_string ) free( val.psz_string );
+ free( val.psz_string );
}
else
{
{
input_DecoderDelete( p_sys->es[i]->p_dec );
}
- if( p_sys->es[i]->psz_language )
- free( p_sys->es[i]->psz_language );
- if( p_sys->es[i]->psz_language_code )
- free( p_sys->es[i]->psz_language_code );
+ free( p_sys->es[i]->psz_language );
+ free( p_sys->es[i]->psz_language_code );
es_format_Clean( &p_sys->es[i]->fmt );
free( p_sys->es[i] );
free( p_sys->ppsz_sub_language );
}
- if( p_sys->es )
- free( p_sys->es );
+ free( p_sys->es );
/* FIXME duplicate work EsOutProgramDel (but we cannot use it) add a EsOutProgramClean ? */
for( i = 0; i < p_sys->i_pgrm; i++ )
{
es_out_pgrm_t *p_pgrm = p_sys->pgrm[i];
- if( p_pgrm->psz_now_playing )
- free( p_pgrm->psz_now_playing );
- if( p_pgrm->psz_publisher )
- free( p_pgrm->psz_publisher );
- if( p_pgrm->psz_name )
- free( p_pgrm->psz_name );
+ free( p_pgrm->psz_now_playing );
+ free( p_pgrm->psz_publisher );
+ free( p_pgrm->psz_name );
if( p_pgrm->p_epg )
vlc_epg_Delete( p_pgrm->p_epg );
/* If program is selected we need to unselect it */
if( p_sys->p_pgrm == p_pgrm ) p_sys->p_pgrm = NULL;
- if( p_pgrm->psz_name ) free( p_pgrm->psz_name );
- if( p_pgrm->psz_now_playing ) free( p_pgrm->psz_now_playing );
- if( p_pgrm->psz_publisher ) free( p_pgrm->psz_publisher );
+ free( p_pgrm->psz_name );
+ free( p_pgrm->psz_now_playing );
+ free( p_pgrm->psz_publisher );
if( p_pgrm->p_epg )
vlc_epg_Delete( p_pgrm->p_epg );
free( p_pgrm );
/* TODO update epg name */
free( psz_cat );
}
- if( p_pgrm->psz_name ) free( p_pgrm->psz_name );
+ free( p_pgrm->psz_name );
p_pgrm->psz_name = strdup( psz_title );
/* ugly but it works */
free( psz_epg );
#endif
/* Update now playing */
- if( p_pgrm->psz_now_playing )
- free( p_pgrm->psz_now_playing );
+ free( p_pgrm->psz_now_playing );
p_pgrm->psz_now_playing = NULL;
if( p_epg->p_current && p_epg->p_current->psz_name && *p_epg->p_current->psz_name )
p_pgrm->psz_now_playing = strdup( p_epg->p_current->psz_name );
EsOutSelect( out, p_sys->es[i], VLC_FALSE );
}
- if( es->psz_language )
- free( es->psz_language );
- if( es->psz_language_code )
- free( es->psz_language_code );
+ free( es->psz_language );
+ free( es->psz_language_code );
es_format_Clean( &es->fmt );
}
free( subs[i] );
}
- if( subs ) free( subs );
- if( psz_autopath ) free( psz_autopath );
+ free( subs );
+ free( psz_autopath );
}
free( psz_subtitle );
InputSourceClean( p_input->p->slave[i] );
free( p_input->p->slave[i] );
}
- if( p_input->p->slave ) free( p_input->p->slave );
+ free( p_input->p->slave );
/* Unload all modules */
if( p_input->p->p_es_out )
sizeof(input_attachment_t**) * ( i_attachment + i_new ) );
for( i = 0; i < i_new; i++ )
attachment[i_attachment++] = pp_new[i];
- if( pp_new )
- free( pp_new );
+ free( pp_new );
/* */
*pi_attachment = i_attachment;
if( p_sys->b_block ) block_ChainRelease( p_sys->block.p_first );
else free( p_sys->stream.p_buffer );
- if( p_sys->p_peek ) free( p_sys->p_peek );
+ free( p_sys->p_peek );
if( p_sys->p_list_access && p_sys->p_list_access != p_sys->p_access )
access2_Delete( p_sys->p_list_access );
{
free( p_sys->list[p_sys->i_list]->psz_path );
free( p_sys->list[p_sys->i_list] );
- if( !p_sys->i_list ) free( p_sys->list );
+ free( p_sys->list );
}
free( s->p_sys );
msg_Err( s, "iconv failed" );
msg_Dbg( s, "original: %d, in %d, out %d", i_line, (int)i_in, (int)i_out );
}
- if( p_line ) free( p_line );
+ free( p_line );
p_line = psz_new_line;
i_line = (size_t)i_line - i_out; /* does not include \0 */
}
var_Change( p_input, val.psz_string, VLC_VAR_ADDCHOICE,
&val2, &text2 );
- if( text2.psz_string ) free( text2.psz_string );
+ free( text2.psz_string );
}
}
}
var_Change( p_input, "chapter", VLC_VAR_ADDCHOICE, &val, &text );
- if( text.psz_string ) free( text.psz_string );
+ free( text.psz_string );
}
}
{
MISSING( "output" );
- if( p_cfg->psz_output != NULL )
- free( p_cfg->psz_output );
+ free( p_cfg->psz_output );
p_cfg->psz_output = *psz_value ? strdup( psz_value ) : NULL;
i++;
}
if( !p_cfg->b_vod )
ERROR( "invalid mux option for broadcast" );
- if( p_cfg->vod.psz_mux )
- free( p_cfg->vod.psz_mux );
+ free( p_cfg->vod.psz_mux );
p_cfg->vod.psz_mux = *psz_value ? strdup( psz_value ) : NULL;
i++;
}
TAB_REMOVE( vlm->i_schedule, vlm->schedule, sched );
- if( vlm->i_schedule == 0 && vlm->schedule ) free( vlm->schedule );
+ if( vlm->i_schedule == 0 ) free( vlm->schedule );
free( sched->psz_name );
while( sched->i_command )
{
void vlm_MessageDelete( vlm_message_t *p_message )
{
- if( p_message->psz_name ) free( p_message->psz_name );
- if( p_message->psz_value ) free( p_message->psz_value );
+ free( p_message->psz_name );
+ free( p_message->psz_value );
while( p_message->i_child-- )
vlm_MessageDelete( p_message->child[p_message->i_child] );
- if( p_message->child ) free( p_message->child );
+ free( p_message->child );
free( p_message );
}
sout_DeleteInstance( p_instance->p_sout );
input_ItemClean( &p_instance->item );
- if( p_instance->psz_name )
- free( p_instance->psz_name );
+ free( p_instance->psz_name );
free( p_instance );
}
static void video_release_buffer( picture_t *p_pic )
{
- if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig );
- if( p_pic && p_pic->p_sys ) free( p_pic->p_sys );
- if( p_pic ) free( p_pic );
+ if( p_pic )
+ {
+ free( p_pic->p_data_orig );
+ free( p_pic->p_sys );
+ free( p_pic );
+ }
}
static picture_t *video_new_buffer( decoder_t *p_dec )
static void video_del_buffer( decoder_t *p_dec, picture_t *p_pic )
{
(void)p_dec;
- if( p_pic && p_pic->p_data_orig ) free( p_pic->p_data_orig );
- if( p_pic && p_pic->p_sys ) free( p_pic->p_sys );
- if( p_pic ) free( p_pic );
+ if( p_pic )
+ {
+ free( p_pic->p_data_orig );
+ free( p_pic->p_sys );
+ free( p_pic );
+ }
}
static void video_link_picture( decoder_t *p_dec, picture_t *p_pic )
if( QUEUE(i).pp_sub[j] == p_sub )
{
REMOVE_ELEM( QUEUE(i).pp_sub, QUEUE(i).i_sub, j );
- if( p_sub ) free( p_sub );
+ free( p_sub );
}
}
vlc_mutex_unlock( & QUEUE(i).lock );
p_obj->psz_header );
}
}
- if( psz_old ) free( psz_old );
+ free( psz_old );
p_obj = p_obj->p_parent;
}
if( p_queue->b_overflow )
{
- if( p_item->psz_module )
- free( p_item->psz_module );
- if( p_item->psz_msg )
- free( p_item->psz_msg );
- if( p_item->psz_header )
- free( p_item->psz_header );
+ free( p_item->psz_module );
+ free( p_item->psz_msg );
+ free( p_item->psz_header );
}
vlc_mutex_unlock ( &p_queue->lock );
i_index != i_stop;
i_index = (i_index+1) % VLC_MSG_QSIZE )
{
- if( p_queue->msg[i_index].psz_msg )
- free( p_queue->msg[i_index].psz_msg );
- if( p_queue->msg[i_index].psz_module )
- free( p_queue->msg[i_index].psz_module );
- if( p_queue->msg[i_index].psz_header )
- free( p_queue->msg[i_index].psz_header );
+ free( p_queue->msg[i_index].psz_msg );
+ free( p_queue->msg[i_index].psz_module );
+ free( p_queue->msg[i_index].psz_header );
}
/* Update the new start value */
free( p_priv->p_vars );
vlc_mutex_destroy( &p_priv->var_lock );
- if( p_this->psz_header ) free( p_this->psz_header );
+ free( p_this->psz_header );
if( p_this->i_object_type == VLC_OBJECT_GLOBAL )
{
free( p_s );
i--;
}
- if( p_c->psz_name ) free( p_c->psz_name );
+ free( p_c->psz_name );
free( p_c );
}
}
for( i = 0 ; i < p_var->choices.i_count ; i++ )
{
p_var->pf_free( &p_var->choices.p_values[i] );
- if( p_var->choices_text.p_values[i].psz_string )
- free( p_var->choices_text.p_values[i].psz_string );
+ free( p_var->choices_text.p_values[i].psz_string );
}
free( p_var->choices.p_values );
free( p_var->choices_text.p_values );
}
free( p_var->psz_name );
- if( p_var->psz_text ) free( p_var->psz_text );
+ free( p_var->psz_text );
memmove( p_priv->p_vars + i_var,
p_priv->p_vars + i_var + 1,
}
p_var->pf_free( &p_var->choices.p_values[i] );
- if( p_var->choices_text.p_values[i].psz_string )
- free( p_var->choices_text.p_values[i].psz_string );
+ free( p_var->choices_text.p_values[i].psz_string );
REMOVE_ELEM( p_var->choices.p_values, p_var->choices.i_count, i );
REMOVE_ELEM( p_var->choices_text.p_values,
p_var->choices_text.i_count, i );
p_var->pf_free( &p_var->choices.p_values[i] );
}
for( i = 0 ; i < p_var->choices_text.i_count ; i++ )
- {
- if( p_var->choices_text.p_values[i].psz_string )
- free( p_var->choices_text.p_values[i].psz_string );
- }
+ free( p_var->choices_text.p_values[i].psz_string );
+
if( p_var->choices.i_count ) free( p_var->choices.p_values );
if( p_var->choices_text.i_count ) free( p_var->choices_text.p_values );
if( p_val2 && p_val2->p_list )
{
for( i = 0; i < p_val2->p_list->i_count; i++ )
- if( p_val2->p_list->p_values[i].psz_string )
- free( p_val2->p_list->p_values[i].psz_string );
+ free( p_val2->p_list->p_values[i].psz_string );
if( p_val2->p_list->i_count )
{
free( p_val2->p_list->p_values );
}
break;
case VLC_VAR_SETTEXT:
- if( p_var->psz_text ) free( p_var->psz_text );
+ free( p_var->psz_text );
if( p_val && p_val->psz_string )
p_var->psz_text = strdup( p_val->psz_string );
break;
INSERT_ELEM( p_list->pi_types, p_list->i_count,
p_list->i_count, VLC_VAR_INTEGER );
}
- if( psz_orig ) free( psz_orig );
+ free( psz_orig );
break;
}
INSERT_ELEM( p_list->pi_types, p_list->i_count,
p_list->i_count, VLC_VAR_INTEGER );
}
- if( psz_orig ) free( psz_orig );
+ free( psz_orig );
break;
}
default:
void
services_discovery_SetLocalizedName ( services_discovery_t * p_sd, const char *psz )
{
- if(p_sd->psz_localized_name) free( p_sd->psz_localized_name );
+ free( p_sd->psz_localized_name );
p_sd->psz_localized_name = strdup(psz);
}