Bug 1248637: Prune duplicate CANCELLED candidate pairs. r?drno
MozReview-Commit-ID: HeErN7xMxbQ
--- a/media/mtransport/nricemediastream.cpp
+++ b/media/mtransport/nricemediastream.cpp
@@ -339,17 +339,19 @@ nsresult NrIceMediaStream::GetCandidateP
/* In case of duplicate pairs we only report the one winning pair */
if (
((p2->remote->component && (p2->remote->component->active == p2)) &&
!(p1->remote->component && (p1->remote->component->active == p1))) ||
((p2->peer_nominated || p2->nominated) &&
!(p1->peer_nominated || p1->nominated)) ||
(p2->priority > p1->priority) ||
((p2->state == NR_ICE_PAIR_STATE_SUCCEEDED) &&
- (p1->state != NR_ICE_PAIR_STATE_SUCCEEDED))
+ (p1->state != NR_ICE_PAIR_STATE_SUCCEEDED)) ||
+ ((p2->state != NR_ICE_PAIR_STATE_CANCELLED) &&
+ (p1->state == NR_ICE_PAIR_STATE_CANCELLED))
) {
/* p2 is a better pair. */
break;
}
}
p2=TAILQ_NEXT(p2, check_queue_entry);
}
if (p2) {