Ticket #11077: alsa_mute.diff

File alsa_mute.diff, 942 bytes (added by stuartm, 12 years ago)
  • mythtv/libs/libmyth/audio/audiooutputalsa.cpp

    commit e0dd20024d95e1d9913e0d4c3a55560a3b211b36
    Author: Stuart Morgan <smorgan@mythtv.org>
    Date:   Tue Sep 11 17:57:00 2012 +0100
    
        Actually mute the mixer when using ALSA.
    
    diff --git a/mythtv/libs/libmyth/audio/audiooutputalsa.cpp b/mythtv/libs/libmyth/audio/audiooutputalsa.cpp
    index ab0a11a..40ae6d0 100644
    a b void AudioOutputALSA::SetVolumeChannel(int channel, int volume) 
    876876    mixervol = min(mixervol, m_mixer.volmax);
    877877
    878878    snd_mixer_selem_channel_id_t chan = (snd_mixer_selem_channel_id_t) channel;
     879
     880    if (snd_mixer_selem_has_playback_switch(m_mixer.elem))
     881        snd_mixer_selem_set_playback_switch(m_mixer.elem, chan, (volume > 0));
     882
    879883    if (snd_mixer_selem_set_playback_volume(m_mixer.elem, chan, mixervol) < 0)
    880884        VBERROR(QString("failed to set channel %1 volume").arg(channel));
    881885    else