React only to the first stream info signal port-changes-from-branch-2.x.y-to-default

Thu, 03 Oct 2019 11:16:08 +0200

author
Fabrice Bellet <fabrice@bellet.info>
date
Thu, 03 Oct 2019 11:16:08 +0200
branch
port-changes-from-branch-2.x.y-to-default
changeset 40269
334fd0d7c7e6
parent 40268
a7be471404ba
child 40270
88bc25476614

React only to the first stream info signal

libpurple/protocols/jabber/jingle/rtp.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/jabber/jingle/rtp.c	Thu Oct 03 10:34:22 2019 +0200
+++ b/libpurple/protocols/jabber/jingle/rtp.c	Thu Oct 03 11:16:08 2019 +0200
@@ -217,8 +217,15 @@
 				session);
 
 		g_object_unref(session);
-	} else if (type == PURPLE_MEDIA_INFO_ACCEPT &&
+	/* The same signal is emited *four* times in case of acceptance
+	 * by purple_media_stream_info() (stream acceptance, session
+	 * acceptance, participant acceptance, and conference acceptance).
+	 * We only react to the first one, where sid and name are given
+	 * non-null values.
+	 */
+	} else if (type == PURPLE_MEDIA_INFO_ACCEPT && sid && name &&
 			jingle_session_is_initiator(session) == FALSE) {
+
 		jingle_rtp_ready(session);
 	}
 }

mercurial