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
=== modified file 'src/volume-control.vala'
--- src/volume-control.vala 2013-09-30 12:13:32 +0000
+++ src/volume-control.vala 2013-10-28 23:52:19 +0000
@@ -27,6 +27,8 @@
27 /* this is static to ensure it being freed after @context (loop does not have ref counting) */27 /* this is static to ensure it being freed after @context (loop does not have ref counting) */
28 private static PulseAudio.GLibMainLoop loop;28 private static PulseAudio.GLibMainLoop loop;
2929
30 private uint _reconnect_timer = 0;
31
30 private PulseAudio.Context context;32 private PulseAudio.Context context;
31 private bool _mute = true;33 private bool _mute = true;
32 private double _volume = 0.0;34 private double _volume = 0.0;
@@ -49,6 +51,13 @@
49 this.reconnect_to_pulse ();51 this.reconnect_to_pulse ();
50 }52 }
5153
54 ~VolumeControl ()
55 {
56 if (_reconnect_timer != 0) {
57 Source.remove (_reconnect_timer);
58 }
59 }
60
52 /* PulseAudio logic*/61 /* PulseAudio logic*/
53 private void context_events_cb (Context c, Context.SubscriptionEventType t, uint32 index)62 private void context_events_cb (Context c, Context.SubscriptionEventType t, uint32 index)
54 {63 {
@@ -152,7 +161,8 @@
152161
153 case Context.State.FAILED:162 case Context.State.FAILED:
154 case Context.State.TERMINATED:163 case Context.State.TERMINATED:
155 this.reconnect_to_pulse ();164 if (_reconnect_timer == 0)
165 _reconnect_timer = Timeout.add_seconds (2, reconnect_timeout);
156 break;166 break;
157167
158 default: 168 default:
@@ -161,6 +171,13 @@
161 }171 }
162 }172 }
163173
174 bool reconnect_timeout ()
175 {
176 _reconnect_timer = 0;
177 reconnect_to_pulse ();
178 return false; // G_SOURCE_REMOVE
179 }
180
164 void reconnect_to_pulse ()181 void reconnect_to_pulse ()
165 {182 {
166 if (this.ready) {183 if (this.ready) {

Subscribers

People subscribed via source and target branches