Merge lp:~charlesk/indicator-sound/lp-1244010-13.10 into lp:indicator-sound/13.10

Proposed by Charles Kerr
Status: Merged
Approved by: Lars Karlitski
Approved revision: 391
Merged at revision: 391
Proposed branch: lp:~charlesk/indicator-sound/lp-1244010-13.10
Merge into: lp:indicator-sound/13.10
Diff against target: 50 lines (+18/-1)
1 file modified
src/volume-control.vala (+18/-1)
To merge this branch: bzr merge lp:~charlesk/indicator-sound/lp-1244010-13.10
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Lars Karlitski (community) Approve
Review via email: mp+192973@code.launchpad.net

Description of the change

backport the recursively-restart-pulse bugfix from trunk.

To post a comment you must log in.
Revision history for this message
Lars Karlitski (larsu) wrote :

ok.

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/volume-control.vala'
2--- src/volume-control.vala 2013-09-30 12:13:32 +0000
3+++ src/volume-control.vala 2013-10-28 23:52:19 +0000
4@@ -27,6 +27,8 @@
5 /* this is static to ensure it being freed after @context (loop does not have ref counting) */
6 private static PulseAudio.GLibMainLoop loop;
7
8+ private uint _reconnect_timer = 0;
9+
10 private PulseAudio.Context context;
11 private bool _mute = true;
12 private double _volume = 0.0;
13@@ -49,6 +51,13 @@
14 this.reconnect_to_pulse ();
15 }
16
17+ ~VolumeControl ()
18+ {
19+ if (_reconnect_timer != 0) {
20+ Source.remove (_reconnect_timer);
21+ }
22+ }
23+
24 /* PulseAudio logic*/
25 private void context_events_cb (Context c, Context.SubscriptionEventType t, uint32 index)
26 {
27@@ -152,7 +161,8 @@
28
29 case Context.State.FAILED:
30 case Context.State.TERMINATED:
31- this.reconnect_to_pulse ();
32+ if (_reconnect_timer == 0)
33+ _reconnect_timer = Timeout.add_seconds (2, reconnect_timeout);
34 break;
35
36 default:
37@@ -161,6 +171,13 @@
38 }
39 }
40
41+ bool reconnect_timeout ()
42+ {
43+ _reconnect_timer = 0;
44+ reconnect_to_pulse ();
45+ return false; // G_SOURCE_REMOVE
46+ }
47+
48 void reconnect_to_pulse ()
49 {
50 if (this.ready) {

Subscribers

People subscribed via source and target branches