[vlc-devel] [PATCH 3/3] libvlc: disable audio mute on VolumeUp/Down

Rémi Denis-Courmont remi at remlab.net
Tue Jan 5 20:11:36 CET 2010


Le mardi 5 janvier 2010 19:01:54 Francois Cartegnie, vous avez écrit :
> ---
>  src/audio_output/intf.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/src/audio_output/intf.c b/src/audio_output/intf.c
> index b7b24aa..902d57b 100644
> --- a/src/audio_output/intf.c
> +++ b/src/audio_output/intf.c
> @@ -132,7 +132,8 @@ int __aout_VolumeSet( vlc_object_t * p_object,
>  audio_volume_t i_volume ) int __aout_VolumeUp( vlc_object_t * p_object,
>  int i_nb_steps,
>                     audio_volume_t * pi_volume )
>  {
> -
> +    if ( __aout_IsMuted( p_object ) )
> +        __aout_ToggleMute( p_object, pi_volume );


This will fail if someone else touches the mute setting concurrently. 
Generally, 'A <- false' is much better than 'if A then A <- !A'.

-- 
Rémi Denis-Courmont
http://www.remlab.net/
http://fi.linkedin.com/in/remidenis



More information about the vlc-devel mailing list