--- a/ChangeLog Wed Mar 07 23:45:56 2018 -0600
+++ b/ChangeLog Wed Mar 07 23:53:17 2018 -0600
@@ -42,6 +42,9 @@
* Fix handling of search results (#17238 David Woodhouse)
+ * Port backend-fs to newer api for farstream relay-info property (#17274 bellet) version 2.12.0 (03/09/2017):
* Fix an out of bounds memory write in purple_markup_unescape_entity.
--- a/libpurple/media/backend-fs2.c Wed Mar 07 23:45:56 2018 -0600
+++ b/libpurple/media/backend-fs2.c Wed Mar 07 23:53:17 2018 -0600
@@ -2093,6 +2093,7 @@
(GSourceFunc)src_pad_added_cb_cb, stream);
append_relay_info(GValueArray *relay_info, const gchar *ip, gint port,
const gchar *username, const gchar *password, const gchar *type)
@@ -2118,6 +2119,7 @@
create_stream(PurpleMediaBackendFs2 *self,
@@ -2144,6 +2146,10 @@
TURN modes, like Google f.ex. */
gboolean got_turn_from_prpl = FALSE;
+ GPtrArray *relay_info = g_ptr_array_new_full (1, (GDestroyNotify) gst_structure_free); session = get_session(self, sess_id);
@@ -2208,7 +2214,9 @@
if (turn_ip && purple_strequal("nice", transmitter) && !got_turn_from_prpl) {
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
GValueArray *relay_info = g_value_array_new(0);
G_GNUC_END_IGNORE_DEPRECATIONS
const gchar *username = purple_prefs_get_string(
@@ -2219,15 +2227,37 @@
port = purple_prefs_get_int("/purple/network/turn_port");
relay_info = append_relay_info(relay_info, turn_ip, port, username,
+ g_ptr_array_add (relay_info, + gst_structure_new ("relay-info", + "ip", G_TYPE_STRING, turn_ip, + "port", G_TYPE_UINT, port, + "username", G_TYPE_STRING, username, + "password", G_TYPE_STRING, password, + "relay-type", G_TYPE_STRING, "udp", port = purple_prefs_get_int("/purple/network/turn_port_tcp");
relay_info = append_relay_info(relay_info, turn_ip, port, username,
+ g_ptr_array_add (relay_info, + gst_structure_new ("relay-info", + "ip", G_TYPE_STRING, turn_ip, + "port", G_TYPE_UINT, port, + "username", G_TYPE_STRING, username, + "password", G_TYPE_STRING, password, + "relay-type", G_TYPE_STRING, "tcp", /* TURN over SSL is only supported by libnice for Google's "psuedo" SSL mode
@@ -2237,9 +2267,14 @@
"Setting relay-info on new stream\n");
_params[_num_params].name = "relay-info";
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
g_value_init(&_params[_num_params].value, G_TYPE_VALUE_ARRAY);
g_value_set_boxed(&_params[_num_params].value, relay_info);
g_value_array_free(relay_info);
+ g_value_init(&_params[_num_params].value, G_TYPE_PTR_ARRAY); + g_value_set_boxed(&_params[_num_params].value, relay_info); G_GNUC_END_IGNORE_DEPRECATIONS
@@ -2264,16 +2299,20 @@
- if (!fs_stream_set_transmitter(fsstream, transmitter,
- _params, _num_params, &err)) {
+ ret = fs_stream_set_transmitter(fsstream, transmitter, + _params, _num_params, &err); + for (i = 0 ; i < _num_params ; i++) + g_value_unset (&_params[i].value); + g_ptr_array_unref (relay_info); purple_debug_error("backend-fs2",
"Could not set transmitter %s: %s.\n",
transmitter, err ? err->message : NULL);
stream = g_new0(PurpleMediaBackendFs2Stream, 1);