# HG changeset patch # User Marcus Lundblad # Date 1266187331 0 # Node ID 025fe823a921a60edd676e6b870d929897674e7c # Parent d873eeaccfc2fdff1e22af98ea9b09ef46fb9170 Fix merge and a compilation error diff -r d873eeaccfc2 -r 025fe823a921 libpurple/media.c --- a/libpurple/media.c Fri Jan 08 23:33:51 2010 +0000 +++ b/libpurple/media.c Sun Feb 14 22:42:11 2010 +0000 @@ -2754,7 +2754,13 @@ FsStream *fsstream = NULL; const gchar *stun_ip = purple_network_get_stun_ip(); const gchar *turn_ip = purple_network_get_turn_ip(); - + guint new_num_params = + !stun_ip && !turn_ip ? num_params + 1 : + (stun_ip && is_nice) && turn_ip ? + num_params + 3 : num_params + 2; + guint next_param_index = num_params; + GParameter *param = g_new0(GParameter, new_num_params); + /* check if the prpl has already specified a relay-info we need to do this to allow them to override when using non-standard TURN modes, like Google f.ex. */ @@ -2768,14 +2774,15 @@ } } + memcpy(param, params, sizeof(GParameter) * num_params); + + /* set controlling mode according to direction */ + param[next_param_index].name = "controlling-mode"; + g_value_init(¶m[next_param_index].value, G_TYPE_BOOLEAN); + g_value_set_boolean(¶m[next_param_index].value, initiator); + next_param_index++; + if (stun_ip || (turn_ip && !got_turn_from_prpl)) { - guint new_num_params = - (stun_ip && is_nice && turn_ip && !got_turn_from_prpl) ? - 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); - if (stun_ip) { purple_debug_info("media", "setting property stun-ip on new stream: %s\n", stun_ip); diff -r d873eeaccfc2 -r 025fe823a921 libpurple/network.h --- a/libpurple/network.h Fri Jan 08 23:33:51 2010 +0000 +++ b/libpurple/network.h Sun Feb 14 22:42:11 2010 +0000 @@ -252,7 +252,7 @@ void purple_network_set_turn_server(const gchar *turn_server); /** - * Get the IP address of the STUN server as a string representation + * Get the IP address of the TURN server as a string representation * * @return the IP address * @since 2.6.0 diff -r d873eeaccfc2 -r 025fe823a921 libpurple/protocols/jabber/jingle/jingle.c --- a/libpurple/protocols/jabber/jingle/jingle.c Fri Jan 08 23:33:51 2010 +0000 +++ b/libpurple/protocols/jabber/jingle/jingle.c Sun Feb 14 22:42:11 2010 +0000 @@ -35,6 +35,9 @@ #include "rtp.h" #include +#ifdef USE_VV +#include +#endif GType jingle_get_type(const gchar *type)