Bug 1472321: Make sure sink identity is set on recvonly/inactive transceivers. r?mjf
MozReview-Commit-ID: jZHsDKN5o6
--- a/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
+++ b/media/webrtc/signaling/src/mediapipeline/MediaPipeline.cpp
@@ -1491,16 +1491,21 @@ MediaPipelineTransmit::UpdateSinkIdentit
if (aTrack != nullptr && aTrack != mDomTrack) {
// If a track is specified, then it might not be for this pipeline,
// since we receive notifications for all tracks on the PC.
// nullptr means that the PeerIdentity has changed and shall be applied
// to all tracks of the PC.
return;
}
+ if (!mDomTrack) {
+ // Nothing to do here
+ return;
+ }
+
bool enableTrack = aPrincipal->Subsumes(mDomTrack->GetPrincipal());
if (!enableTrack) {
// first try didn't work, but there's a chance that this is still available
// if our track is bound to a peerIdentity, and the peer connection (our
// sink) is bound to the same identity, then we can enable the track.
const PeerIdentity* trackIdentity = mDomTrack->GetPeerIdentity();
if (aSinkIdentity && trackIdentity) {
enableTrack = (*aSinkIdentity == *trackIdentity);
--- a/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
+++ b/media/webrtc/signaling/src/peerconnection/TransceiverImpl.cpp
@@ -120,17 +120,17 @@ TransceiverImpl::InitVideo()
mReceiveTrack);
}
nsresult
TransceiverImpl::UpdateSinkIdentity(const dom::MediaStreamTrack* aTrack,
nsIPrincipal* aPrincipal,
const PeerIdentity* aSinkIdentity)
{
- if (!(mJsepTransceiver->mJsDirection & sdp::kSend)) {
+ if (mJsepTransceiver->IsStopped()) {
return NS_OK;
}
mTransmitPipeline->UpdateSinkIdentity_m(aTrack, aPrincipal, aSinkIdentity);
return NS_OK;
}
void