[gnome-settings-daemon] media-keys: Fix volume underflow



commit a0410ebb15109ee44ca103079d1da7225ec88214
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Jan 17 15:28:33 2011 +0000

    media-keys: Fix volume underflow
    
    When reducing the volume and the volume is already low, avoid
    underflowing it. Spotted by Sjoerd Simons
    <sjoerd simons collabora co uk>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=637569

 plugins/media-keys/gsd-media-keys-manager.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/media-keys/gsd-media-keys-manager.c b/plugins/media-keys/gsd-media-keys-manager.c
index 81f163a..1c1b2cf 100644
--- a/plugins/media-keys/gsd-media-keys-manager.c
+++ b/plugins/media-keys/gsd-media-keys-manager.c
@@ -664,7 +664,10 @@ do_sound_action (GsdMediaKeysManager *manager,
                                 sound_changed = TRUE;
                         }
                 } else {
-                        vol = vol - norm_vol_step;
+                        if (vol <= norm_vol_step)
+                                vol = 0;
+                        else
+                                vol = vol - norm_vol_step;
                         if (gvc_mixer_stream_set_volume (manager->priv->stream, vol) != FALSE) {
                                 gvc_mixer_stream_push_volume (manager->priv->stream);
                                 sound_changed = TRUE;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]