Bug 1591199: Fix a race where sRD(offer) could mute a track, then an RTP packet could arrive that unmutes it before negotiation completed, this time without needing to stop the conduit and send a bunch of extra RTCP BYEs. r=mjf

Differential Revision: https://phabricator.services.mozilla.com/D59521

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Byron Campen [:bwc] 2020-02-06 15:50:58 +00:00
Родитель 4d3a18f5ff
Коммит 8ae1152c9d
1 изменённых файлов: 17 добавлений и 2 удалений

Просмотреть файл

@ -253,6 +253,8 @@ void TransceiverImpl::SetReceiveTrackMuted(bool aMuted) {
return;
}
MOZ_MTLOG(ML_DEBUG, mPCHandle << "[" << mMid << "]: " << __FUNCTION__
<< " aMuted=" << aMuted);
// This sets the muted state for mReceiveTrack and all its clones.
static_cast<RemoteTrackSource&>(mReceiveTrack->GetSource()).SetMuted(aMuted);
}
@ -449,6 +451,13 @@ void TransceiverImpl::SyncWithJS(dom::RTCRtpTransceiver& aJsTransceiver,
}
}
// If a SRD has unset the receive bit, stop the receive pipeline so incoming
// RTP does not unmute the receive track.
if (!mJsepTransceiver->mRecvTrack.GetRemoteSetSendBit() ||
!mJsepTransceiver->mRecvTrack.GetActive()) {
mReceivePipeline->Stop();
}
// mid from JSEP
if (mJsepTransceiver->IsAssociated()) {
aJsTransceiver.SetMid(
@ -980,9 +989,15 @@ void TransceiverImpl::GetRtpSources(
audio_conduit->GetRtpSources(aTimeNow, outSources);
}
void TransceiverImpl::OnRtcpBye() { SetReceiveTrackMuted(true); }
void TransceiverImpl::OnRtcpBye() {
MOZ_MTLOG(ML_DEBUG, mPCHandle << "[" << mMid << "]: " << __FUNCTION__);
SetReceiveTrackMuted(true);
}
void TransceiverImpl::OnRtcpTimeout() { SetReceiveTrackMuted(true); }
void TransceiverImpl::OnRtcpTimeout() {
MOZ_MTLOG(ML_DEBUG, mPCHandle << "[" << mMid << "]: " << __FUNCTION__);
SetReceiveTrackMuted(true);
}
void TransceiverImpl::InsertAudioLevelForContributingSource(
const uint32_t aSource, const int64_t aTimestamp,