Commit 9d50cb1b authored by Olivier Crête's avatar Olivier Crête

agent: Only add pairs once on gathering done

Also don't try to re-add pairs that already have been added
parent 921ab719
......@@ -1902,7 +1902,8 @@ void agent_gathering_done (NiceAgent *agent)
break;
}
if (m == NULL) {
conn_check_add_for_candidate (agent, stream->id, component, remote_candidate);
conn_check_add_for_candidate_pair (agent, stream->id, component,
local_candidate, remote_candidate);
}
}
}
......
......@@ -1444,7 +1444,7 @@ static void priv_conn_check_add_for_candidate_pair_matched (NiceAgent *agent,
}
}
static gboolean priv_conn_check_add_for_candidate_pair (NiceAgent *agent,
gboolean conn_check_add_for_candidate_pair (NiceAgent *agent,
guint stream_id, Component *component, NiceCandidate *local,
NiceCandidate *remote)
{
......@@ -1502,7 +1502,7 @@ int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *
for (i = component->local_candidates; i ; i = i->next) {
NiceCandidate *local = i->data;
ret = priv_conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
ret = conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
if (ret) {
++added;
......@@ -1533,7 +1533,7 @@ int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Compo
for (i = component->remote_candidates; i ; i = i->next) {
NiceCandidate *remote = i->data;
ret = priv_conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
ret = conn_check_add_for_candidate_pair (agent, stream_id, component, local, remote);
if (ret) {
++added;
......
......@@ -96,6 +96,7 @@ struct _CandidateCheckPair
int conn_check_add_for_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *remote);
int conn_check_add_for_local_candidate (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local);
gboolean conn_check_add_for_candidate_pair (NiceAgent *agent, guint stream_id, Component *component, NiceCandidate *local, NiceCandidate *remote);
void conn_check_free (NiceAgent *agent);
gboolean conn_check_schedule_next (NiceAgent *agent);
int conn_check_send (NiceAgent *agent, CandidateCheckPair *pair);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment