Commit c0fe2d35 authored by Filippo Carone's avatar Filippo Carone

libvlc_audio_set_mute logically simpler

parent 4e4171f1
......@@ -50,21 +50,11 @@ vlc_bool_t libvlc_audio_get_mute( libvlc_instance_t *p_instance,
return VLC_FALSE;
}
void libvlc_audio_set_mute( libvlc_instance_t *p_instance, vlc_bool_t status,
void libvlc_audio_set_mute( libvlc_instance_t *p_instance, vlc_bool_t mute,
libvlc_exception_t *p_e )
{
if ( status )
if ( mute ^ libvlc_audio_get_mute( p_instance, p_e ) )
{
/* Check if the volume is already muted */
if (! libvlc_audio_get_volume( p_instance, p_e ) )
{
return;
}
aout_VolumeMute( p_instance->p_libvlc_int, NULL );
}
else
{
/* the aout_VolumeMute is a toggle function, so this is enough. */
aout_VolumeMute( p_instance->p_libvlc_int, NULL );
}
}
......
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