diff options
author | Fabrice Bellet <fabrice@bellet.info> | 2016-06-06 22:24:50 +0200 |
---|---|---|
committer | Fabrice Bellet <fabrice@bellet.info> | 2017-06-12 17:55:45 +0200 |
commit | 7a2c1edf502849a868b6f1026e8e2c343dee4ded (patch) | |
tree | 24cdde3ccf4d15246c39b553302a67b19dbd06c3 | |
parent | 8bb210c5af4bcaf342d7fa4fef6034269e976532 (diff) | |
download | libnice-7a2c1edf502849a868b6f1026e8e2c343dee4ded.tar.gz |
conncheck: update selected pair when nominated flag is set
This modifies commit 8f1f615. It is better focused to update the
selected pair just after its nominated flag has been set. We also keep
the code homogeneous with other places, where the call to
priv_update_selected_pair() immediately follows the setting of
pair->nominated. Moreover in priv_update_check_list_state_for_ready(),
we would call priv_update_selected_pair() more times that necessary when
iterating on all nominated pairs.
Differential Revision: https://phabricator.freedesktop.org/D1125
-rw-r--r-- | agent/conncheck.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/agent/conncheck.c b/agent/conncheck.c index 14fdcd9..8c55269 100644 --- a/agent/conncheck.c +++ b/agent/conncheck.c @@ -76,6 +76,8 @@ static void conn_check_free_item (gpointer data); static CandidateCheckPair *priv_conn_check_add_for_candidate_pair_matched ( NiceAgent *agent, guint stream_id, NiceComponent *component, NiceCandidate *local, NiceCandidate *remote, NiceCheckState initial_state); +static gboolean priv_update_selected_pair (NiceAgent *agent, + NiceComponent *component, CandidateCheckPair *pair); static int priv_timer_expired (GTimeVal *timer, GTimeVal *now) { @@ -515,6 +517,7 @@ static gboolean priv_conn_check_tick_stream (NiceStream *stream, NiceAgent *agen p->state == NICE_CHECK_DISCOVERED)) { nice_debug ("Agent %p : restarting check %p as the nominated pair.", agent, p); p->nominated = TRUE; + priv_update_selected_pair (agent, component, p); priv_add_pair_to_triggered_check_queue (agent, p); break; /* move to the next component */ } @@ -1530,7 +1533,6 @@ static void priv_update_check_list_state_for_ready (NiceAgent *agent, NiceStream ++valid; if (p->nominated == TRUE) { ++nominated; - priv_update_selected_pair (agent, component, p); } } } |