changeset 26387:189ac8d13103

Fix assertion stating FsRawUdpTransmitter doesn't have a relay-info property.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Thu, 19 Mar 2009 12:26:01 +0000
parents 7e24c04ab5c9
children 5906409c4b69
files libpurple/media.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/media.c	Thu Mar 19 10:46:41 2009 +0000
+++ b/libpurple/media.c	Thu Mar 19 12:26:01 2009 +0000
@@ -1886,6 +1886,7 @@
 	PurpleMediaStream *stream = NULL;
 	FsStreamDirection *direction = NULL;
 	PurpleMediaSessionType session_type;
+	gboolean is_nice = !strcmp(transmitter, "nice");
 
 	g_return_val_if_fail(PURPLE_IS_MEDIA(media), FALSE);
 
@@ -1939,7 +1940,7 @@
 		 * receiving the src-pad-added signal.
 		 * Only works for non-multicast FsRtpSessions.
 		 */
-		if (!strcmp(transmitter, "nice") || !strcmp(transmitter, "rawudp"))
+		if (is_nice || !strcmp(transmitter, "rawudp"))
 			g_object_set(G_OBJECT(session->session),
 					"no-rtcp-timeout", 0, NULL);
 
@@ -1986,7 +1987,8 @@
 
 		if (stun_ip || turn_ip) {
 			guint new_num_params = 
-				stun_ip && turn_ip ? num_params + 2 : num_params + 1;
+					(stun_ip && is_nice) && turn_ip ?
+					num_params + 2 : num_params + 1;
 			guint next_param_index = num_params;
 			GParameter *param = g_new0(GParameter, new_num_params);
 			memcpy(param, params, sizeof(GParameter) * num_params);
@@ -2001,7 +2003,7 @@
 				next_param_index++;
 			}
 
-			if (turn_ip) {
+			if (turn_ip && is_nice) {
 				GValueArray *relay_info = g_value_array_new(0);
 				GValue value;
 				gint turn_port =