]> git.sesse.net Git - vlc/commitdiff
No need to check for the existence of the variable to destroy it.
authorRémi Duraffort <ivoire@videolan.org>
Fri, 24 Jul 2009 07:05:58 +0000 (09:05 +0200)
committerRémi Duraffort <ivoire@videolan.org>
Fri, 24 Jul 2009 07:07:53 +0000 (09:07 +0200)
Destroying directly saves one Lookup.

src/audio_output/dec.c
src/audio_output/intf.c

index b31b02f4af6b4db366d8aff428f48994a001a3e3..a0bbe372eeab76c607f1afd728b2509bacbd6777 100644 (file)
@@ -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 );
index e20ecfdbac3443af533d33e138dbcd83b55954bd..db9d64a219c0facdf27b230e3360151fd6782a2a 100644 (file)
@@ -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;