]> git.sesse.net Git - vlc/blobdiff - src/audio_output/intf.c
Don't recreate the same table over and over and over
[vlc] / src / audio_output / intf.c
index e373298c38b8eca9be24f02bf15da8a238c50d68..95e20b880b7802cbdd49f069132a86691ab5b710 100644 (file)
@@ -122,33 +122,6 @@ int __aout_VolumeSet( vlc_object_t * p_object, audio_volume_t i_volume )
     return i_result;
 }
 
-/*****************************************************************************
- * aout_VolumeInfos : get the boundary pi_soft
- *****************************************************************************/
-int __aout_VolumeInfos( vlc_object_t * p_object, audio_volume_t * pi_soft )
-{
-    aout_instance_t * p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
-                                                FIND_ANYWHERE );
-    int i_result;
-
-    if ( p_aout == NULL ) return 0;
-
-    aout_lock_mixer( p_aout );
-    if ( p_aout->mixer.b_error )
-    {
-        /* The output module is destroyed. */
-        i_result = -1;
-    }
-    else
-    {
-        i_result = p_aout->output.pf_volume_infos( p_aout, pi_soft );
-    }
-    aout_unlock_mixer( p_aout );
-
-    vlc_object_release( p_aout );
-    return i_result;
-}
-
 /*****************************************************************************
  * aout_VolumeUp : raise the output volume
  *****************************************************************************
@@ -167,30 +140,10 @@ int __aout_VolumeUp( vlc_object_t * p_object, int i_nb_steps,
         i_volume = AOUT_VOLUME_MAX;
     else if ( i_volume < AOUT_VOLUME_MIN )
         i_volume = AOUT_VOLUME_MIN;
-
-    config_PutInt( p_object, "volume", i_volume );
-    var_Create( p_object->p_libvlc, "saved-volume", VLC_VAR_INTEGER );
-    var_SetInteger( p_object->p_libvlc, "saved-volume" , i_volume );
     if ( pi_volume != NULL )
         *pi_volume = i_volume;
 
-    var_SetBool( p_object->p_libvlc, "volume-change", true );
-
-    aout_instance_t *p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
-                                               FIND_ANYWHERE );
-    if ( p_aout == NULL )
-        return 0;
-
-    int i_result;
-    aout_lock_mixer( p_aout );
-    if ( !p_aout->mixer.b_error )
-        i_result = p_aout->output.pf_volume_set( p_aout, i_volume );
-    else
-        i_result = VLC_SUCCESS;
-    aout_unlock_mixer( p_aout );
-
-    vlc_object_release( p_aout );
-    return i_result;
+    return __aout_VolumeSet( p_object, i_volume );
 }
 
 /*****************************************************************************
@@ -248,7 +201,6 @@ void aout_VolumeSoftInit( aout_instance_t * p_aout )
 {
     int i_volume;
 
-    p_aout->output.pf_volume_infos = aout_VolumeSoftInfos;
     p_aout->output.pf_volume_get = aout_VolumeSoftGet;
     p_aout->output.pf_volume_set = aout_VolumeSoftSet;
 
@@ -265,14 +217,6 @@ void aout_VolumeSoftInit( aout_instance_t * p_aout )
     aout_VolumeSoftSet( p_aout, (audio_volume_t)i_volume );
 }
 
-/* Placeholder for pf_volume_infos(). */
-int aout_VolumeSoftInfos( aout_instance_t * p_aout, audio_volume_t * pi_soft )
-{
-    (void)p_aout;
-    *pi_soft = 0;
-    return 0;
-}
-
 /* Placeholder for pf_volume_get(). */
 int aout_VolumeSoftGet( aout_instance_t * p_aout, audio_volume_t * pi_volume )
 {
@@ -297,18 +241,10 @@ int aout_VolumeSoftSet( aout_instance_t * p_aout, audio_volume_t i_volume )
 /* Meant to be called by the output plug-in's Open(). */
 void aout_VolumeNoneInit( aout_instance_t * p_aout )
 {
-    p_aout->output.pf_volume_infos = aout_VolumeNoneInfos;
     p_aout->output.pf_volume_get = aout_VolumeNoneGet;
     p_aout->output.pf_volume_set = aout_VolumeNoneSet;
 }
 
-/* Placeholder for pf_volume_infos(). */
-int aout_VolumeNoneInfos( aout_instance_t * p_aout, audio_volume_t * pi_soft )
-{
-    (void)p_aout; (void)pi_soft;
-    return -1;
-}
-
 /* Placeholder for pf_volume_get(). */
 int aout_VolumeNoneGet( aout_instance_t * p_aout, audio_volume_t * pi_volume )
 {