cpw.maiku.media_refactor: fd0aef2f: Handle individual streams in the Fs2 bac...

maiku at pidgin.im maiku at pidgin.im
Wed Oct 28 16:12:39 EDT 2009


-----------------------------------------------------------------
Revision: fd0aef2fed1b4d8e3e63f7524149d0345e50cfbe
Ancestor: eb4d99b323c58cb833e2499561a7cab8afed0d92
Author: maiku at pidgin.im
Date: 2009-10-28T19:01:33
Branch: im.pidgin.cpw.maiku.media_refactor
URL: http://d.pidgin.im/viewmtn/revision/info/fd0aef2fed1b4d8e3e63f7524149d0345e50cfbe

Modified files:
        libpurple/media/backend-fs2.c

ChangeLog: 

Handle individual streams in the Fs2 backend's stream-info callback for accept
signals.

-------------- next part --------------
============================================================
--- libpurple/media/backend-fs2.c	5b797b6eb3f8501d3a607ead7603c2aa507ca100
+++ libpurple/media/backend-fs2.c	c6dc4e43841201d3381dd0d5dab2107eefb812fe
@@ -1079,32 +1079,28 @@ _stream_info_cb(PurpleMedia *media, Purp
 		gchar *sid, gchar *name, gboolean local,
 		PurpleMediaBackendFs2 *self)
 {
-	if (type == PURPLE_MEDIA_INFO_ACCEPT) {
-		GList *streams = _get_streams(self, sid, name);
-		
-		for (; streams; streams =
-				g_list_delete_link(streams, streams)) {
-			PurpleMediaBackendFs2Stream *stream = streams->data;
-			GError *err = NULL;
+	if (type == PURPLE_MEDIA_INFO_ACCEPT && sid != NULL && name != NULL) {
+		PurpleMediaBackendFs2Stream *stream =
+				_get_stream(self, sid, name);
+		GError *err = NULL;
 
-			g_object_set(G_OBJECT(stream->stream), "direction",
-					_session_type_to_fs_stream_direction(
-					stream->session->type), NULL);
+		g_object_set(G_OBJECT(stream->stream), "direction",
+				_session_type_to_fs_stream_direction(
+				stream->session->type), NULL);
 
-			if (stream->remote_candidates == NULL)
-				continue;
+		if (stream->remote_candidates == NULL)
+			return;
 
-			fs_stream_set_remote_candidates(stream->stream,
-					stream->remote_candidates, &err);
+		fs_stream_set_remote_candidates(stream->stream,
+				stream->remote_candidates, &err);
 
-			if (err == NULL)
-				continue;
+		if (err == NULL)
+			return;
 
-			purple_debug_error("backend-fs2", "Error adding "
-					"remote candidates: %s\n",
-					err->message);
-			g_error_free(err);
-		}
+		purple_debug_error("backend-fs2", "Error adding "
+				"remote candidates: %s\n",
+				err->message);
+		g_error_free(err);
 	} else if (local == TRUE && (type == PURPLE_MEDIA_INFO_MUTE ||
 			type == PURPLE_MEDIA_INFO_UNMUTE)) {
 		PurpleMediaBackendFs2Private *priv =


More information about the Commits mailing list