Merge lp:~ted/indicator-sound/deduplicate-with-reason into lp:indicator-sound/15.04

Proposed by Ted Gould
Status: Merged
Approved by: Ted Gould
Approved revision: 493
Merged at revision: 493
Proposed branch: lp:~ted/indicator-sound/deduplicate-with-reason
Merge into: lp:indicator-sound/15.04
Diff against target: 50 lines (+21/-19)
1 file modified
src/volume-control-pulse.vala (+21/-19)
To merge this branch: bzr merge lp:~ted/indicator-sound/deduplicate-with-reason
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Ricardo Salveti (community) Approve
Review via email: mp+256698@code.launchpad.net

Commit message

Always record the volume whether we do something with it or not (LP: #1446703)

Description of the change

Make sure we always store the updated reason so we don't get notifications for extra events.

To post a comment you must log in.
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Looks good, fix a regression introduced by my previous change (my bad).

review: Approve
Revision history for this message
Ted Gould (ted) wrote :

Putting back to Needs Approval so that Jenkins will build a package.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

Switching back to Approved now that we have a deb that people can test with.

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-04-13 06:02:29 +0000
3+++ src/volume-control-pulse.vala 2015-04-17 17:12:09 +0000
4@@ -616,25 +616,27 @@
5 return _volume;
6 }
7 set {
8- if (value.volume != _volume.volume) {
9- debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason);
10-
11- var old_high_volume = this.high_volume;
12- _volume = value;
13-
14- /* Make sure we're connected to Pulse and pulse didn't give us the change */
15- if (context.get_state () == Context.State.READY &&
16- _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE)
17- if (_pulse_use_stream_restore)
18- set_volume_active_role.begin ();
19- else
20- context.get_server_info (server_info_cb_for_set_volume);
21-
22- if (this.high_volume != old_high_volume)
23- this.notify_property("high-volume");
24-
25- if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET)
26- start_local_volume_timer();
27+ var volume_changed = (value.volume != _volume.volume);
28+ debug("Setting volume to %f for profile %d because %d", value.volume, _active_sink_input, value.reason);
29+
30+ var old_high_volume = this.high_volume;
31+ _volume = value;
32+
33+ /* Make sure we're connected to Pulse and pulse didn't give us the change */
34+ if (context.get_state () == Context.State.READY &&
35+ _volume.reason != VolumeControl.VolumeReasons.PULSE_CHANGE &&
36+ volume_changed)
37+ if (_pulse_use_stream_restore)
38+ set_volume_active_role.begin ();
39+ else
40+ context.get_server_info (server_info_cb_for_set_volume);
41+
42+ if (this.high_volume != old_high_volume)
43+ this.notify_property("high-volume");
44+
45+ if (volume.reason != VolumeControl.VolumeReasons.ACCOUNTS_SERVICE_SET
46+ && volume_changed) {
47+ start_local_volume_timer();
48 }
49 }
50 }

Subscribers

People subscribed via source and target branches