20080729225431-3e2dc-85693ecd8d6ea78b1119be140ccbb9611f4e4051.gz
---
 plugins/rtp/rtpstream.c |   34 +++++++++++++++++++++++++++++++---
 1 files changed, 31 insertions(+), 3 deletions(-)

diff --git a/plugins/rtp/rtpstream.c b/plugins/rtp/rtpstream.c
index d54ac35..aba41b8 100644
--- a/plugins/rtp/rtpstream.c
+++ b/plugins/rtp/rtpstream.c
@@ -4566,8 +4566,20 @@ farsight_rtp_stream_set_remote_candidate_list 
(FarsightStream *stream,
                                                const GList *remote_candidates)
 {
   FarsightRTPStream *self = (FarsightRTPStream *) stream;
+  GList *list_copy = NULL;
 
-  self->priv->remote_candidates = 
farsight_transport_list_copy(remote_candidates);
+  for (; remote_candidates; remote_candidates = g_list_next 
(remote_candidates))
+  {
+    FarsightTransportInfo *fti = remote_candidates->data;
+
+    if (fti->component == 0)
+      fti->component = 1;
+
+    if (fti->component == 1)
+      list_copy = g_list_append (list_copy, farsight_transport_copy (fti));
+  }
+
+  self->priv->remote_candidates = list_copy;
 }
 
 static void
@@ -4576,12 +4588,28 @@ farsight_rtp_stream_add_remote_candidate 
(FarsightStream *stream,
 {
   FarsightRTPStream *self = (FarsightRTPStream *) stream;
   FarsightTransportInfo *info = (FarsightTransportInfo 
*)remote_candidate->data;
-  GList *rc_copy;
+  GList *rc_copy = NULL;
+  GList *item = NULL;
 
   STREAM_DEBUG (self, "adding remote candidate %s %d", info->ip, info->port);
   info = NULL;
 
-  rc_copy = farsight_transport_list_copy (remote_candidate);
+  for (item = (GList*) remote_candidate; item; item = g_list_next (item))
+  {
+    FarsightTransportInfo *fti = item->data;
+
+    if (fti->component == 0)
+      fti->component = 1;
+
+    if (fti->component == 1)
+      rc_copy = g_list_append (rc_copy, farsight_transport_copy (fti));
+  }
+
+  if (!rc_copy)
+  {
+    STREAM_WARNING (self, "no remote candidate for component 1");
+    return;
+  }
 
   if (self->priv->remote_candidates == NULL)
   {
-- 
1.5.6.5



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Farsight-devel mailing list
Farsight-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/farsight-devel

Reply via email to