aboutsummaryrefslogtreecommitdiff
path: root/src/pulseaudio-mgr.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-02-10 14:34:51 +0000
committerConor Curran <conor.curran@canonical.com>2011-02-10 14:34:51 +0000
commitc8dc3a51330c1d70eb896f3686e1794028a4e5f7 (patch)
treedf01a00d0b3466ce2dec29535a742d34b01badee /src/pulseaudio-mgr.c
parentb3eb8aa450fa3dff6cbc324e85a441cb1321184b (diff)
downloadayatana-indicator-sound-c8dc3a51330c1d70eb896f3686e1794028a4e5f7.tar.gz
ayatana-indicator-sound-c8dc3a51330c1d70eb896f3686e1794028a4e5f7.tar.bz2
ayatana-indicator-sound-c8dc3a51330c1d70eb896f3686e1794028a4e5f7.zip
remember to cancel the reconnect timeout loop once a connection has been established
Diffstat (limited to 'src/pulseaudio-mgr.c')
-rw-r--r--src/pulseaudio-mgr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pulseaudio-mgr.c b/src/pulseaudio-mgr.c
index 1a2b3e0..3aed1f1 100644
--- a/src/pulseaudio-mgr.c
+++ b/src/pulseaudio-mgr.c
@@ -126,8 +126,6 @@ reconnect_to_pulse (gpointer user_data)
g_warning ("Failed to connect context: %s",
pa_strerror (pa_context_errno (pulse_context)));
}
-
- reconnect_idle_id = 0;
if (connection_attempts > 5){
return FALSE;
}
@@ -236,6 +234,10 @@ pm_context_state_callback (pa_context *c, void *userdata)
case PA_CONTEXT_READY:
connection_attempts = 0;
g_debug("PA_CONTEXT_READY");
+ if (reconnect_idle_id != 0){
+ g_source_remove (reconnect_idle_id);
+ reconnect_idle_id = 0;
+ }
pa_operation *o;
pa_context_set_subscribe_callback(c, pm_subscribed_events_callback, userdata);