summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2014-03-28 01:10:02 (GMT)
committerOlivier CrĂȘte <olivier.crete@collabora.com>2014-03-31 20:40:45 (GMT)
commit8e779dfb669a172592ef5e41137a8e30e6969ec7 (patch)
tree43397834b042c293c9ad5e3b1fb1f9877ad81f7f
parentd0b76154952e95020dc9778461d28be522b8b9c6 (diff)
downloadlibnice-8e779dfb669a172592ef5e41137a8e30e6969ec7.tar.gz
libnice-8e779dfb669a172592ef5e41137a8e30e6969ec7.tar.xz
agent: Prevent nice_agent_set_port_range() from being called after a gather
The port range is only used when gathering, print a critical if it is called afterwards as it will have no effect.
-rw-r--r--agent/agent.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/agent/agent.c b/agent/agent.c
index c4b8a79..b041af7 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -2411,13 +2411,19 @@ NICEAPI_EXPORT void
nice_agent_set_port_range (NiceAgent *agent, guint stream_id, guint component_id,
guint min_port, guint max_port)
{
+ Stream *stream;
Component *component;
agent_lock();
- if (agent_find_component (agent, stream_id, component_id, NULL, &component)) {
- component->min_port = min_port;
- component->max_port = max_port;
+ if (agent_find_component (agent, stream_id, component_id, &stream,
+ &component)) {
+ if (stream->gathering_started) {
+ g_critical ("nice_agent_gather_candidates (stream_id=%u) already called for this stream", stream_id);
+ } else {
+ component->min_port = min_port;
+ component->max_port = max_port;
+ }
}
agent_unlock_and_emit (agent);