Merge lp:~rsalveti/indicator-sound/only_set_volume_different_reason_not_As into lp:indicator-sound/15.04

Proposed by Ricardo Salveti
Status: Merged
Approved by: Charles Kerr
Approved revision: no longer in the source branch.
Merged at revision: 490
Proposed branch: lp:~rsalveti/indicator-sound/only_set_volume_different_reason_not_As
Merge into: lp:indicator-sound/15.04
Diff against target: 46 lines (+20/-17)
1 file modified
src/volume-control-pulse.vala (+20/-17)
To merge this branch: bzr merge lp:~rsalveti/indicator-sound/only_set_volume_different_reason_not_As
Reviewer Review Type Date Requested Status
Charles Kerr (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+255781@code.launchpad.net

Commit message

volume-control-pulse: only set volume if value is indeed different and reason not from AS

Description of the change

volume-control-pulse: only set volume if value is indeed different and reason not from AS

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Charles Kerr (charlesk) wrote :

LGTM.

review: Approve
490. By Ricardo Salveti

volume-control-pulse: only set volume if value is indeed different and reason not from AS

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/volume-control-pulse.vala'
2--- src/volume-control-pulse.vala 2015-02-27 22:34:23 +0000
3+++ src/volume-control-pulse.vala 2015-04-12 04:11:32 +0000
4@@ -608,23 +608,26 @@
5 return _volume;
6 }
7 set {
8- debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason);
9-
10- var old_high_volume = this.high_volume;
11- _volume = value;
12-
13- /* Make sure we're connected to Pulse and pulse didn't give us the change */
14- if (context.get_state () == Context.State.READY &&
15- _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE)
16- if (_pulse_use_stream_restore)
17- set_volume_active_role.begin ();
18- else
19- context.get_server_info (server_info_cb_for_set_volume);
20-
21- if (this.high_volume != old_high_volume)
22- this.notify_property("high-volume");
23-
24- start_local_volume_timer();
25+ if (value.volume != _volume.volume) {
26+ debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason);
27+
28+ var old_high_volume = this.high_volume;
29+ _volume = value;
30+
31+ /* Make sure we're connected to Pulse and pulse didn't give us the change */
32+ if (context.get_state () == Context.State.READY &&
33+ _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE)
34+ if (_pulse_use_stream_restore)
35+ set_volume_active_role.begin ();
36+ else
37+ context.get_server_info (server_info_cb_for_set_volume);
38+
39+ if (this.high_volume != old_high_volume)
40+ this.notify_property("high-volume");
41+
42+ if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET)
43+ start_local_volume_timer();
44+ }
45 }
46 }
47

Subscribers

People subscribed via source and target branches