[farsight2/master] Install the stun-port prop with the correct prop-id, free the stun_ip before replacing it, dont zero-out the error pointer and and return an error if the object can't be created
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:19:31 PST 2008
---
transmitters/rawudp/fs-rawudp-stream-transmitter.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.c b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
index c39de47..bd0a8d3 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
@@ -204,7 +204,7 @@ fs_rawudp_stream_transmitter_class_init (FsRawUdpStreamTransmitterClass *klass)
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE));
g_object_class_install_property (gobject_class,
- PROP_STUN_IP,
+ PROP_STUN_PORT,
g_param_spec_uint ("stun-port",
"The port of the STUN server",
"The IPv4 UDP port of the STUN server as a ",
@@ -417,6 +417,7 @@ fs_rawudp_stream_transmitter_set_property (GObject *object,
self->priv->prefered_local_candidates = g_value_dup_boxed (value);
break;
case PROP_STUN_IP:
+ g_free (self->priv->stun_ip);
self->priv->stun_ip = g_value_dup_string (value);
break;
case PROP_STUN_PORT:
@@ -487,15 +488,12 @@ fs_rawudp_stream_transmitter_build (FsRawUdpStreamTransmitter *self,
if (!self->priv->rtp_udpport)
return FALSE;
-
self->priv->rtcp_udpport =
fs_rawudp_transmitter_get_udpport (self->priv->transmitter,
FS_COMPONENT_RTCP, rtcp_ip, rtcp_port, error);
if (!self->priv->rtcp_udpport)
return FALSE;
-
-
if (ip) {
self->priv->local_forced_rtp_candidate =
fs_rawudp_stream_transmitter_build_forced_candidate (self, ip,
@@ -611,16 +609,19 @@ fs_rawudp_stream_transmitter_add_remote_candidate (
FsRawUdpStreamTransmitter *
fs_rawudp_stream_transmitter_newv (FsRawUdpTransmitter *transmitter,
- guint n_parameters, GParameter *parameters,
- GError **error)
+ guint n_parameters, GParameter *parameters, GError **error)
{
FsRawUdpStreamTransmitter *streamtransmitter = NULL;
- error = NULL;
-
streamtransmitter = g_object_newv (FS_TYPE_RAWUDP_STREAM_TRANSMITTER,
n_parameters, parameters);
+ if (!streamtransmitter) {
+ g_set_error (error, FS_ERROR, FS_ERROR_CONSTRUCTION,
+ "Could not build the stream transmitter");
+ return NULL;
+ }
+
streamtransmitter->priv->transmitter = transmitter;
if (!fs_rawudp_stream_transmitter_build (streamtransmitter, error)) {
--
1.5.6.5
More information about the farsight-commits
mailing list