[farsight2/master] Only connect the agent new candidate signal after the initial gathering is done

Olivier Crête olivier.crete at collabora.co.uk
Tue Dec 23 15:26:34 PST 2008


---
 transmitters/nice/fs-nice-stream-transmitter.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/transmitters/nice/fs-nice-stream-transmitter.c b/transmitters/nice/fs-nice-stream-transmitter.c
index 4255e1c..1a4467c 100644
--- a/transmitters/nice/fs-nice-stream-transmitter.c
+++ b/transmitters/nice/fs-nice-stream-transmitter.c
@@ -1098,8 +1098,6 @@ fs_nice_stream_transmitter_build (FsNiceStreamTransmitter *self,
       "candidate-gathering-done", G_CALLBACK (agent_gathering_done), self);
   self->priv->new_selected_pair_handler_id = g_signal_connect (agent->agent,
       "new-selected-pair", G_CALLBACK (agent_new_selected_pair), self);
-  self->priv->new_candidate_handler_id = g_signal_connect (agent->agent,
-      "new-candidate", G_CALLBACK (agent_new_candidate), self);
 
 
   self->priv->gststream = fs_nice_transmitter_add_gst_stream (
@@ -1331,6 +1329,10 @@ agent_gathering_done (NiceAgent *agent, guint stream_id, gpointer user_data)
     g_slist_free (candidates);
   }
   g_signal_emit_by_name (self, "local-candidates-prepared");
+
+  if (!self->priv->new_candidate_handler_id)
+    self->priv->new_candidate_handler_id = g_signal_connect (agent->agent,
+        "new-candidate", G_CALLBACK (agent_new_candidate), self);
 }
 
 
-- 
1.5.6.5




More information about the farsight-commits mailing list