- vlc_value_t val;
- aout_instance_t * p_aout = vlc_object_find( p_object, VLC_OBJECT_AOUT,
- FIND_ANYWHERE );
- int i_result = 0, i_volume = 0, i_volume_step = 0;
-
- i_volume_step = config_GetInt( p_object->p_libvlc, "volume-step" );
- i_volume = config_GetInt( p_object, "volume" );
- i_volume += i_volume_step * i_nb_steps;
- if ( i_volume > AOUT_VOLUME_MAX )
- {
- i_volume = AOUT_VOLUME_MAX;
- }
- 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" ,
- (audio_volume_t) i_volume );
- if ( pi_volume != NULL ) *pi_volume = (audio_volume_t) i_volume;
-
- val.b_bool = true;
- var_Set( p_object->p_libvlc, "volume-change", val );
-
- if ( p_aout == NULL ) return 0;
-
- vlc_mutex_lock( &p_aout->mixer_lock );
- if ( !p_aout->mixer.b_error )
- {
- i_result = p_aout->output.pf_volume_set( p_aout,
- (audio_volume_t) i_volume );
- }
- vlc_mutex_unlock( &p_aout->mixer_lock );
-
- vlc_object_release( p_aout );
- return i_result;