changeset 26052:997bbae7b80f

Set remote candidates as soon as they are received.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 17 Jan 2009 04:36:40 +0000
parents b68a88fb7458
children c334a9e17426
files libpurple/media.c
diffstat 1 files changed, 9 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Sat Jan 17 04:18:23 2009 +0000
+++ b/libpurple/media.c	Sat Jan 17 04:36:40 2009 +0000
@@ -1184,21 +1184,6 @@
 	return media->priv->pipeline;
 }
 
-static void
-purple_media_set_remote_candidates(PurpleMediaStream *stream)
-{
-	GError *err = NULL;
-
-	fs_stream_set_remote_candidates(stream->stream,
-			stream->remote_candidates, &err);
-
-	if (err) {
-		purple_debug_error("media", "Error adding remote"
-				" candidates: %s\n", err->message);
-		g_error_free(err);
-	}
-}
-
 void
 purple_media_error(PurpleMedia *media, const gchar *error, ...)
 {
@@ -1235,7 +1220,6 @@
 
 	for (; streams; streams = g_list_next(streams)) {
 		PurpleMediaStream *stream = streams->data;
-		purple_media_set_remote_candidates(stream);
 		g_object_set(G_OBJECT(stream->stream), "direction",
 				purple_media_to_fs_stream_direction(
 				stream->session->type), NULL);
@@ -1758,11 +1742,18 @@
 				   const gchar *name, GList *remote_candidates)
 {
 	PurpleMediaStream *stream = purple_media_get_stream(media, sess_id, name);
+	GError *err = NULL;
+
 	stream->remote_candidates = g_list_concat(stream->remote_candidates,
 			purple_media_candidate_list_to_fs(remote_candidates));
 
-	if (stream->session->accepted == TRUE) {
-		purple_media_set_remote_candidates(stream);
+	fs_stream_set_remote_candidates(stream->stream,
+			stream->remote_candidates, &err);
+
+	if (err) {
+		purple_debug_error("media", "Error adding remote"
+				" candidates: %s\n", err->message);
+		g_error_free(err);
 	}
 }