Bug 906986 - Rework fix for
Bug 1241690 to avoid reliance on NrIceCtx inside NrIceMediaStream.
MozReview-Commit-ID: 6pJRjDL63eg
--- a/media/mtransport/nricemediastream.cpp
+++ b/media/mtransport/nricemediastream.cpp
@@ -302,17 +302,17 @@ nsresult NrIceMediaStream::GetActivePair
nsresult NrIceMediaStream::GetCandidatePairs(std::vector<NrIceCandidatePair>*
out_pairs) const {
MOZ_ASSERT(out_pairs);
if (!stream_) {
return NS_ERROR_NOT_AVAILABLE;
}
// If we haven't at least started checking then there is nothing to report
- if (ctx_->connection_state() == NrIceCtx::ICE_CTX_INIT) {
+ if (ctx_->peer()->state != NR_ICE_PEER_STATE_PAIRED) {
return NS_OK;
}
// Get the check_list on the peer stream (this is where the check_list
// actually lives, not in stream_)
nr_ice_media_stream* peer_stream;
int r = nr_ice_peer_ctx_find_pstream(ctx_->peer(), stream_, &peer_stream);
if (r != 0) {
@@ -484,17 +484,17 @@ nsresult NrIceMediaStream::GetLocalCandi
nsresult NrIceMediaStream::GetRemoteCandidates(
std::vector<NrIceCandidate>* candidates) const {
if (!stream_) {
return NS_ERROR_NOT_AVAILABLE;
}
// If we haven't at least started checking then there is nothing to report
- if (ctx_->connection_state() == NrIceCtx::ICE_CTX_INIT) {
+ if (ctx_->peer()->state != NR_ICE_PEER_STATE_PAIRED) {
return NS_OK;
}
nr_ice_media_stream* peer_stream;
int r = nr_ice_peer_ctx_find_pstream(ctx_->peer(), stream_, &peer_stream);
if (r != 0) {
return NS_ERROR_FAILURE;
}