Commit bed24e72 authored by Youness Alaoui's avatar Youness Alaoui

Send new-candidate signals for host cands only if the gathering was successful

parent bd11e72d
...@@ -1856,6 +1856,16 @@ nice_agent_gather_candidates ( ...@@ -1856,6 +1856,16 @@ nice_agent_gather_candidates (
stream->gathering = TRUE; stream->gathering = TRUE;
/* Only signal the new candidates after we're sure that the gathering was
* succesfful. But before sending gathering-done */
for (n = 0; n < stream->n_components; n++) {
Component *component = stream_find_component_by_id (stream, n + 1);
for (i = component->local_candidates; i; i = i->next) {
NiceCandidate *candidate = i->data;
agent_signal_new_candidate (agent, candidate);
}
}
/* note: no async discoveries pending, signal that we are ready */ /* note: no async discoveries pending, signal that we are ready */
if (agent->discovery_unsched_items == 0) { if (agent->discovery_unsched_items == 0) {
nice_debug ("Agent %p: Candidate gathering FINISHED, no scheduled items.", nice_debug ("Agent %p: Candidate gathering FINISHED, no scheduled items.",
......
...@@ -491,7 +491,6 @@ NiceCandidate *discovery_add_local_host_candidate ( ...@@ -491,7 +491,6 @@ NiceCandidate *discovery_add_local_host_candidate (
goto errors; goto errors;
component->sockets = g_slist_append (component->sockets, udp_socket); component->sockets = g_slist_append (component->sockets, udp_socket);
agent_signal_new_candidate (agent, candidate);
return candidate; return candidate;
......
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