conncheck: Insert the candidates sorted after setting the priority
authorOlivier Crête <olivier.crete@collabora.com>
Fri, 3 Oct 2014 20:30:16 +0000 (16:30 -0400)
committerOlivier Crête <olivier.crete@collabora.com>
Thu, 9 Oct 2014 20:26:07 +0000 (16:26 -0400)
agent/conncheck.c

index 845ddae..1f57a0a 100644 (file)
@@ -1375,9 +1375,6 @@ static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Componen
   stream = agent_find_stream (agent, stream_id);
   pair = g_slice_new0 (CandidateCheckPair);
 
-  stream->conncheck_list = g_slist_insert_sorted (stream->conncheck_list, pair,
-      (GCompareFunc)conn_check_compare);
-
   pair->agent = agent;
   pair->stream_id = stream_id;
   pair->component_id = component->id;;
@@ -1395,6 +1392,9 @@ static void priv_add_new_check_pair (NiceAgent *agent, guint stream_id, Componen
   pair->nominated = use_candidate;
   pair->controlling = agent->controlling_mode;
 
+  stream->conncheck_list = g_slist_insert_sorted (stream->conncheck_list, pair,
+      (GCompareFunc)conn_check_compare);
+
   nice_debug ("Agent %p : added a new conncheck %p with foundation of '%s' to list %u.", agent, pair, pair->foundation, stream_id);
 
   /* implement the hard upper limit for number of