[telepathy-gabble/master] JingleTransportRawUdp: properly handle incoming RTP+RTCP candidate batch

Senko Rasic senko.rasic at collabora.co.uk
Mon Jun 29 04:43:11 PDT 2009


---
 src/jingle-transport-rawudp.c |   24 +++++++++---------------
 1 files changed, 9 insertions(+), 15 deletions(-)

diff --git a/src/jingle-transport-rawudp.c b/src/jingle-transport-rawudp.c
index 2b8c6bc..75ae7ee 100644
--- a/src/jingle-transport-rawudp.c
+++ b/src/jingle-transport-rawudp.c
@@ -243,6 +243,12 @@ parse_candidates (GabbleJingleTransportIface *obj,
 
   DEBUG ("called");
 
+  if (priv->remote_candidates != NULL)
+    {
+      DEBUG ("already have raw udp candidates, ignoring extra ones");
+      return;
+    }
+
   for (node = transport_node->children; node; node = node->next)
     {
       const gchar *id, *ip, *str;
@@ -256,10 +262,9 @@ parse_candidates (GabbleJingleTransportIface *obj,
       if (str != NULL)
           component = atoi (str);
 
-      /* FIXME: are RTCP components usable in raw-udp? */
-      if (component != 1)
+      if ((component != 1) && (component != 2))
         {
-          DEBUG ("Ignoring non-RTP component %d for now", component);
+          DEBUG ("Ignoring non-RTP/RTCP component %d", component);
           continue;
         }
 
@@ -299,19 +304,8 @@ parse_candidates (GabbleJingleTransportIface *obj,
     }
 
   DEBUG ("emitting %d new remote candidates", g_list_length (candidates));
-
   g_signal_emit (obj, signals[NEW_CANDIDATES], 0, candidates);
-
-  /* if we got any candidates, overwrite previous with new ones */
-  if (candidates != NULL)
-    {
-      /* FIXME: we assume there are no RTCP components and just try the
-       * first candidate */
-      JingleCandidate *c = candidates->data;
-
-      jingle_transport_free_candidates (priv->remote_candidates);
-      priv->remote_candidates = candidates;
-    }
+  priv->remote_candidates = candidates;
 }
 
 /* FIXME: this should be turned into a generic virtual method, and be
-- 
1.5.6.5




More information about the telepathy-commits mailing list