Commit 5f65c5c9 authored by Rémi Duraffort's avatar Rémi Duraffort

No need to check for the existence of the variable to destroy it.

Destroying directly saves one Lookup.
parent 9a61ec48
......@@ -231,14 +231,8 @@ int aout_DecDelete( aout_instance_t * p_aout, aout_input_t * p_input )
{
aout_OutputDelete( p_aout );
aout_MixerDelete( p_aout );
if ( var_Type( p_aout, "audio-device" ) != 0 )
{
var_Destroy( p_aout, "audio-device" );
}
if ( var_Type( p_aout, "audio-channels" ) != 0 )
{
var_Destroy( p_aout, "audio-channels" );
}
var_Destroy( p_aout, "audio-device" );
var_Destroy( p_aout, "audio-channels" );
}
aout_unlock_mixer( p_aout );
......
......@@ -440,14 +440,8 @@ int aout_FindAndRestart( vlc_object_t * p_this, const char *psz_name,
(void)psz_name; (void)oldval; (void)newval; (void)p_data;
if ( p_aout == NULL ) return VLC_SUCCESS;
if ( var_Type( p_aout, "audio-device" ) != 0 )
{
var_Destroy( p_aout, "audio-device" );
}
if ( var_Type( p_aout, "audio-channels" ) != 0 )
{
var_Destroy( p_aout, "audio-channels" );
}
var_Destroy( p_aout, "audio-device" );
var_Destroy( p_aout, "audio-channels" );
aout_Restart( p_aout );
vlc_object_release( p_aout );
......@@ -469,10 +463,7 @@ int aout_ChannelsRestart( vlc_object_t * p_this, const char * psz_variable,
{
/* This is supposed to be a significant change and supposes
* rebuilding the channel choices. */
if ( var_Type( p_aout, "audio-channels" ) >= 0 )
{
var_Destroy( p_aout, "audio-channels" );
}
var_Destroy( p_aout, "audio-channels" );
}
aout_Restart( p_aout );
return 0;
......
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