summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabrice Bellet <fabrice@bellet.info>2017-11-29 11:04:04 +0100
committerOlivier CrĂȘte <olivier.crete@collabora.com>2018-03-23 13:56:19 -0400
commitea05a3d51990d17bbe25984eb5730849f46bfae0 (patch)
tree95d47d77756541767a62421a97b02a8bfec9d488
parent00dfcc6a625e6c6ed758a4b3b4d0858113508a2f (diff)
downloadlibnice-ea05a3d51990d17bbe25984eb5730849f46bfae0.tar.gz
conncheck: dont fail a stream with a empty conncheck list
Since commit 17f30e4, 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 <olivier.crete@collabora.com> Differential Revision: https://phabricator.freedesktop.org/D1895
-rw-r--r--agent/conncheck.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c
index 4d91f41..0ebe7e9 100644
--- a/agent/conncheck.c
+++ b/agent/conncheck.c
@@ -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 */