Commit d79eca2e authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Simplification / memory error handling

parent 54bcbe13
......@@ -888,7 +888,8 @@ static int ReplayGainCallback( vlc_object_t *p_this, char const *psz_cmd,
static void ReplayGainSelect( aout_instance_t *p_aout, aout_input_t *p_input )
{
char *psz_replay_gain = var_GetString( p_aout, "audio-replay-gain-mode" );
char *psz_replay_gain = var_GetNonEmptyString( p_aout,
"audio-replay-gain-mode" );
int i_mode;
int i_use;
float f_gain;
......
......@@ -482,7 +482,7 @@ void aout_EnableFilter( vlc_object_t *p_this, const char *psz_name,
FIND_ANYWHERE );
if( p_aout )
psz_string = var_GetString( p_aout, "audio-filter" );
psz_string = var_GetNonEmptyString( p_aout, "audio-filter" );
else
psz_string = config_GetPsz( p_this, "audio-filter" );
......
......@@ -790,8 +790,8 @@ static int Init( input_thread_t * p_input )
}
/* Find a usable sout and attach it to p_input */
psz = var_GetString( p_input, "sout" );
if( *psz && strncasecmp( p_input->p->input.p_item->psz_uri, "vlc:", 4 ) )
psz = var_GetNonEmptyString( p_input, "sout" );
if( psz && strncasecmp( p_input->p->input.p_item->psz_uri, "vlc:", 4 ) )
{
/* Check the validity of the provided sout */
if( p_input->p->p_sout )
......@@ -985,8 +985,8 @@ static int Init( input_thread_t * p_input )
}
/* Look for and add subtitle files */
psz_subtitle = var_GetString( p_input, "sub-file" );
if( *psz_subtitle )
psz_subtitle = var_GetNonEmptyString( p_input, "sub-file" );
if( psz_subtitle != NULL )
{
msg_Dbg( p_input, "forced subtitle: %s", psz_subtitle );
input_AddSubtitles( p_input, psz_subtitle, VLC_FALSE );
......@@ -1003,7 +1003,7 @@ static int Init( input_thread_t * p_input )
/* Try to autoselect the first autodetected subtitles file
* if no subtitles file was specified */
if( *psz_subtitle == 0 && subs && subs[0] )
if( ( psz_subtitle == NULL ) && subs && subs[0] )
{
input_AddSubtitles( p_input, subs[0], VLC_FALSE );
free( subs[0] );
......@@ -1030,8 +1030,8 @@ static int Init( input_thread_t * p_input )
free( psz_subtitle );
/* Look for slave */
psz = var_GetString( p_input, "input-slave" );
if( *psz )
psz = var_GetNonEmptyString( p_input, "input-slave" );
if( psz != NULL )
{
char *psz_delim;
input_source_t *slave;
......@@ -1059,8 +1059,8 @@ static int Init( input_thread_t * p_input )
else free( slave );
psz = psz_delim;
}
free( psz );
}
if( psz ) free( psz );
}
else
{
......@@ -2224,7 +2224,7 @@ static int InputSourceInit( input_thread_t *p_input,
}
/* */
psz_tmp = psz = var_GetString( p_input, "access-filter" );
psz_tmp = psz = var_GetNonEmptyString( p_input, "access-filter" );
while( psz && *psz )
{
access_t *p_access = in->p_access;
......@@ -2243,7 +2243,7 @@ static int InputSourceInit( input_thread_t *p_input,
psz = end;
}
if( psz_tmp ) free( psz_tmp );
free( psz_tmp );
/* Get infos from access */
if( !p_input->b_preparsing )
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment