Commit 20275947 authored by Mathieu Duponchelle's avatar Mathieu Duponchelle

candidate: fix assertions caused by API guards in new address API

The checks were reversed, requiring for instance a non-relay candidate
for calling nice_candidate_relay_address()
parent 74657cbc
......@@ -475,7 +475,7 @@ nice_candidate_relay_address (const NiceCandidate *candidate, NiceAddress *addr)
const NiceCandidateImpl *c = (NiceCandidateImpl *) candidate;
g_return_if_fail (candidate != NULL);
g_return_if_fail (candidate->type != NICE_CANDIDATE_TYPE_RELAYED);
g_return_if_fail (candidate->type == NICE_CANDIDATE_TYPE_RELAYED);
*addr = c->turn->server;
}
......@@ -486,7 +486,7 @@ nice_candidate_stun_server_address (const NiceCandidate *candidate, NiceAddress
const NiceCandidateImpl *c = (NiceCandidateImpl *) candidate;
g_return_val_if_fail (candidate != NULL, FALSE);
g_return_val_if_fail (candidate->type != NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE, FALSE);
g_return_val_if_fail (candidate->type == NICE_CANDIDATE_TYPE_SERVER_REFLEXIVE, FALSE);
if (c->stun_server) {
*addr = *c->stun_server;
......
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