diff options
author | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2009-06-08 18:46:43 -0400 |
---|---|---|
committer | Youness Alaoui <youness.alaoui@collabora.co.uk> | 2009-06-09 19:39:58 -0400 |
commit | 0fe5f7c2df38d1c9a26b4dffc84537380ffcfd48 (patch) | |
tree | 2a8e208604ea9726b4dcda2d2cede02fb7d158b5 | |
parent | 0407fbbdbb09c3afefd2754bc01cc0c3e6ddc56c (diff) | |
download | libnice-0fe5f7c2df38d1c9a26b4dffc84537380ffcfd48.tar.gz |
fix peer reflexive candidate's priorities for msn/google
-rw-r--r-- | agent/discovery.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/agent/discovery.c b/agent/discovery.c index c12479d..eb77b0a 100644 --- a/agent/discovery.c +++ b/agent/discovery.c @@ -729,7 +729,19 @@ NiceCandidate *discovery_learn_remote_peer_reflexive_candidate ( candidate->transport = NICE_CANDIDATE_TRANSPORT_UDP; candidate->addr = *remote_address; candidate->base_addr = *remote_address; - candidate->priority = priority; + + /* if the check didn't contain the PRIORITY attribute, then the priority will + * be 0, which is invalid... */ + if (priority != 0) { + candidate->priority = priority; + } else if (agent->compatibility == NICE_COMPATIBILITY_GOOGLE) { + candidate->priority = nice_candidate_jingle_priority (candidate); + } else if (agent->compatibility == NICE_COMPATIBILITY_MSN) { + candidate->priority = nice_candidate_msn_priority (candidate); + } else { + candidate->priority = nice_candidate_ice_priority_full + (NICE_CANDIDATE_TYPE_PREF_PEER_REFLEXIVE, 0, component->id); + } candidate->stream_id = stream->id; candidate->component_id = component->id; |