only set volume for pulse channel if volume is actually different from current channe...
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 7 Dec 2012 09:16:26 +0000 (09:16 +0000)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 7 Dec 2012 09:16:26 +0000 (09:16 +0000)
SVN revision: 80422

src/modules/mixer/sys_pulse.c

index 01f0ace61c2aaba0e6bf2fd09b2dffeb7af7c304..d55f675aca65ddeee0e57f772c514f5755cd5ee0 100644 (file)
@@ -545,13 +545,18 @@ e_mixer_pulse_set_volume(E_Mixer_System *self, E_Mixer_Channel *channel, int lef
    n = pulse_sink_channels_count((void *)self);
    for (x = 0; x < n; x++)
      {
+        double vol;
+
+        vol = lround(pulse_sink_channel_volume_get(self, x));
         if (x == 0)
           {
-             id |= pulse_sink_channel_volume_set(conn, (void *)self, x, left);
+             if (vol != left)
+               id |= pulse_sink_channel_volume_set(conn, (void *)self, x, left);
           }
         else if (x == 1)
           {
-             id |= pulse_sink_channel_volume_set(conn, (void *)self, x, right);
+             if (vol != right)
+               id |= pulse_sink_channel_volume_set(conn, (void *)self, x, right);
           }
      }
 #endif