From c8dc3a51330c1d70eb896f3686e1794028a4e5f7 Mon Sep 17 00:00:00 2001 From: Conor Curran Date: Thu, 10 Feb 2011 14:34:51 +0000 Subject: remember to cancel the reconnect timeout loop once a connection has been established --- src/pulseaudio-mgr.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/pulseaudio-mgr.c') 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); -- cgit v1.2.3