Commit ea05a3d5 authored by Fabrice Bellet's avatar Fabrice Bellet Committed by Olivier Crête

conncheck: dont fail a stream with a empty conncheck list

Since commit 17f30e44, we may have a stream with an empty conncheck list,
and such a stream obviously should not be tested for failed components.
Reviewed-by: Olivier Crête's avatarOlivier Crête <olivier.crete@collabora.com>
Differential Revision: https://phabricator.freedesktop.org/D1895
parent 00dfcc6a
......@@ -1832,6 +1832,9 @@ static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStre
* must be fetched before entering the loop*/
guint c, components = stream->n_components;
if (stream->conncheck_list == NULL)
return;
for (i = agent->discovery_list; i; i = i->next) {
CandidateDiscovery *d = i->data;
......@@ -1846,8 +1849,8 @@ static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStre
/* note: iterate the conncheck list for each component separately */
for (c = 0; c < components; c++) {
NiceComponent *comp = NULL;
if (!agent_find_component (agent, stream->id, c+1, NULL, &comp))
NiceComponent *component = NULL;
if (!agent_find_component (agent, stream->id, c+1, NULL, &component))
continue;
nominated = 0;
......@@ -1873,7 +1876,7 @@ static void priv_update_check_list_failed_components (NiceAgent *agent, NiceStre
* Set the component to FAILED only if it actually had remote candidates
* that failed.. */
if (completed && nominated == 0 &&
comp != NULL && comp->remote_candidates != NULL)
component != NULL && component->remote_candidates != NULL)
agent_signal_component_state_change (agent,
stream->id,
(c + 1), /* component-id */
......
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