Commit 7a2c1edf authored by Fabrice Bellet's avatar Fabrice Bellet
Browse files

conncheck: update selected pair when nominated flag is set

This modifies commit 8f1f615e. 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:
parent 8bb210c5
......@@ -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
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
if (p->nominated == TRUE) {
priv_update_selected_pair (agent, component, p);
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