Fix stunServerPort default value usage
The if-else blocks were wrongly disposed, so when the stunServerPort config wasnt set, but the IP was, a STUN server would not be setup in the NiceAgent interface
Also some identation changes according to the git hook suggestions around the code I changed
@@ -533,12 +533,15 @@ WebRtcEndpointImpl::WebRtcEndpointImpl (const boost::property_tree::ptree &conf,
}
uint stunPort = 0;
+
if (!getConfigValue <uint, WebRtcEndpoint> (&stunPort, "stunServerPort",
DEFAULT_STUN_PORT) ) {
GST_INFO ("STUN port not found in config;"
" using default value: %d", DEFAULT_STUN_PORT);
- } else {
+ }
+
std::string stunAddress;
+
if (!getConfigValue <std::string, WebRtcEndpoint> (&stunAddress,
"stunServerAddress") ) {
GST_INFO ("STUN server not found in config;"
@@ -550,7 +553,6 @@ WebRtcEndpointImpl::WebRtcEndpointImpl (const boost::property_tree::ptree &conf,
g_object_set (G_OBJECT (element), "stun-server-port", stunPort, NULL);
g_object_set (G_OBJECT (element), "stun-server", stunAddress.c_str(), NULL);
}
- }
std::string turnURL;
if (getConfigValue <std::string, WebRtcEndpoint> (&turnURL, "turnURL")) {
