[farsight2/master] Add forgotten ifdefs
Olivier Crête
olivier.crete at collabora.co.uk
Tue Dec 23 15:25:15 PST 2008
---
transmitters/rawudp/fs-rawudp-component.c | 9 +++++++++
transmitters/rawudp/fs-rawudp-stream-transmitter.c | 6 ++++++
2 files changed, 15 insertions(+), 0 deletions(-)
diff --git a/transmitters/rawudp/fs-rawudp-component.c b/transmitters/rawudp/fs-rawudp-component.c
index 807110e..a63fbf5 100644
--- a/transmitters/rawudp/fs-rawudp-component.c
+++ b/transmitters/rawudp/fs-rawudp-component.c
@@ -516,10 +516,12 @@ fs_rawudp_component_init (FsRawUdpComponent *self)
((guint32*)self->priv->stun_cookie)[2] = g_random_int ();
((guint32*)self->priv->stun_cookie)[3] = g_random_int ();
+#ifdef HAVE_GUPNP
self->priv->upnp_mapping = TRUE;
self->priv->upnp_discovery = TRUE;
self->priv->upnp_discovery_timeout = DEFAULT_UPNP_DISCOVERY_TIMEOUT;
self->priv->upnp_mapping_timeout = DEFAULT_UPNP_MAPPING_TIMEOUT;
+#endif
self->priv->mutex = g_mutex_new ();
}
@@ -577,11 +579,13 @@ fs_rawudp_component_dispose (GObject *object)
fs_rawudp_component_stop (self);
}
+#ifdef HAVE_GUPNP
if (self->priv->upnp_igd)
{
g_object_unref (self->priv->upnp_igd);
self->priv->upnp_igd = NULL;
}
+#endif
/* Make sure dispose does not run twice. */
self->priv->disposed = TRUE;
@@ -1112,10 +1116,15 @@ fs_rawudp_component_gather_local_candidates (FsRawUdpComponent *self,
if (self->priv->stun_ip && self->priv->stun_port)
return fs_rawudp_component_start_stun (self, error);
+#ifdef HAVE_GUPNP
else if (!self->priv->upnp_igd || !self->priv->upnp_discovery)
return fs_rawudp_component_emit_local_candidates (self, error);
else
return TRUE;
+#else
+ else
+ return fs_rawudp_component_emit_local_candidates (self, error);
+#endif
}
static gboolean
diff --git a/transmitters/rawudp/fs-rawudp-stream-transmitter.c b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
index b80e7db..52f8798 100644
--- a/transmitters/rawudp/fs-rawudp-stream-transmitter.c
+++ b/transmitters/rawudp/fs-rawudp-stream-transmitter.c
@@ -353,11 +353,13 @@ fs_rawudp_stream_transmitter_init (FsRawUdpStreamTransmitter *self)
self->priv->sending = TRUE;
self->priv->associate_on_source = TRUE;
+#ifdef HAVE_GUPNP
self->priv->upnp_mapping = TRUE;
self->priv->upnp_request_timeout = DEFAULT_UPNP_REQUEST_TIMEOUT;
self->priv->upnp_discovery_timeout = DEFAULT_UPNP_DISCOVERY_TIMEOUT;
self->priv->upnp_mapping_timeout = DEFAULT_UPNP_MAPPING_TIMEOUT;
self->priv->upnp_discovery = TRUE;
+#endif
self->priv->mutex = g_mutex_new ();
}
@@ -384,11 +386,13 @@ fs_rawudp_stream_transmitter_dispose (GObject *object)
}
}
+#ifdef HAVE_GUPNP
if (self->priv->upnp_igd)
{
g_object_unref (self->priv->upnp_igd);
self->priv->upnp_igd = NULL;
}
+#endif
/* Make sure dispose does not run twice. */
self->priv->disposed = TRUE;
@@ -543,6 +547,7 @@ fs_rawudp_stream_transmitter_build (FsRawUdpStreamTransmitter *self,
gint c;
guint16 next_port;
+#ifdef HAVE_GUPNP
if (self->priv->upnp_mapping ||
(self->priv->upnp_discovery &&
(!self->priv->stun_ip || !self->priv->stun_port)))
@@ -552,6 +557,7 @@ fs_rawudp_stream_transmitter_build (FsRawUdpStreamTransmitter *self,
"request-timeout", self->priv->upnp_request_timeout,
NULL);
}
+#endif
self->priv->component = g_new0 (FsRawUdpComponent *,
self->priv->transmitter->components + 1);
--
1.5.6.5
More information about the farsight-commits
mailing list