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

Switch the few var_GetString remains to var_GetNonEmptyString

parent 050de848
...@@ -1036,7 +1036,9 @@ void ExtraPanel::CheckAout() ...@@ -1036,7 +1036,9 @@ void ExtraPanel::CheckAout()
p_intf->p_sys->p_aout = p_aout; p_intf->p_sys->p_aout = p_aout;
f_preamp = var_GetFloat( p_aout, "equalizer-preamp" ); f_preamp = var_GetFloat( p_aout, "equalizer-preamp" );
psz_bands = var_GetString( p_aout, "equalizer-bands" ); psz_bands = var_GetNonEmptyString( p_aout, "equalizer-bands" );
if( psz_bands == NULL )
psz_bands = strdup("");
b_update = VLC_TRUE; b_update = VLC_TRUE;
} }
vlc_object_release( p_aout ); vlc_object_release( p_aout );
......
...@@ -158,7 +158,8 @@ static void Run( services_discovery_t *p_sd ) ...@@ -158,7 +158,8 @@ static void Run( services_discovery_t *p_sd )
if( p_sys->b_update == VLC_TRUE ) if( p_sys->b_update == VLC_TRUE )
{ {
msg_Dbg( p_sd, "Update required" ); msg_Dbg( p_sd, "Update required" );
psz_urls = var_GetString( p_sd, "podcast-urls" ); psz_urls = var_GetNonEmptyString( p_sd, "podcast-urls" );
if( psz_urls != NULL )
ParseUrls( p_sd, psz_urls ); ParseUrls( p_sd, psz_urls );
free( psz_urls ); free( psz_urls );
p_sys->b_update = VLC_FALSE; p_sys->b_update = VLC_FALSE;
......
...@@ -359,9 +359,9 @@ char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *p_mi, ...@@ -359,9 +359,9 @@ char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *p_mi,
if( !p_vout ) if( !p_vout )
return 0; return 0;
psz_aspect = var_GetString( p_vout, "aspect-ratio" ); psz_aspect = var_GetNonEmptyString( p_vout, "aspect-ratio" );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
return psz_aspect; return psz_aspect ? psz_aspect : strdup("");
} }
void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *p_mi, void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *p_mi,
...@@ -458,9 +458,9 @@ char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *p_mi, ...@@ -458,9 +458,9 @@ char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *p_mi,
if( !p_vout ) if( !p_vout )
return 0; return 0;
psz_geometry = var_GetString( p_vout, "crop" ); psz_geometry = var_GetNonEmptyString( p_vout, "crop" );
vlc_object_release( p_vout ); vlc_object_release( p_vout );
return psz_geometry; return psz_geometry ? psz_geometry : strdup("");
} }
void libvlc_video_set_crop_geometry( libvlc_media_instance_t *p_mi, void libvlc_video_set_crop_geometry( libvlc_media_instance_t *p_mi,
......
...@@ -50,7 +50,9 @@ demux_t *__demux2_New( vlc_object_t *p_obj, ...@@ -50,7 +50,9 @@ demux_t *__demux2_New( vlc_object_t *p_obj,
if( *p_demux->psz_demux == '\0' ) if( *p_demux->psz_demux == '\0' )
{ {
free( p_demux->psz_demux ); free( p_demux->psz_demux );
p_demux->psz_demux = var_GetString( p_obj, "demux" ); p_demux->psz_demux = var_GetNonEmptyString( p_obj, "demux" );
if( p_demux->psz_demux == NULL )
p_demux->psz_demux = strdup( "" );
} }
if( !b_quick ) if( !b_quick )
......
...@@ -995,11 +995,13 @@ static int Init( input_thread_t * p_input ) ...@@ -995,11 +995,13 @@ static int Init( input_thread_t * p_input )
var_Get( p_input, "sub-autodetect-file", &val ); var_Get( p_input, "sub-autodetect-file", &val );
if( val.b_bool ) if( val.b_bool )
{ {
char *psz_autopath = var_GetString( p_input, "sub-autodetect-path" ); char *psz_autopath = var_GetNonEmptyString( p_input, "sub-autodetect-path" );
char **subs = subtitles_Detect( p_input, psz_autopath, char **subs = subtitles_Detect( p_input, psz_autopath,
p_input->p->input.p_item->psz_uri ); p_input->p->input.p_item->psz_uri );
input_source_t *sub; input_source_t *sub;
i = 0; i = 0;
if( psz_autopath == NULL )
psz_autopath = strdup("");
/* Try to autoselect the first autodetected subtitles file /* Try to autoselect the first autodetected subtitles file
* if no subtitles file was specified */ * if no subtitles file was specified */
......
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