Bug 1673526 - Simplify send track recreation condition. r=bwc

Differential Revision: https://phabricator.services.mozilla.com/D98354
This commit is contained in:
Andreas Pehrson 2021-01-07 10:56:38 +00:00
Родитель 83aebe0e67
Коммит 8da798d630
1 изменённых файлов: 3 добавлений и 3 удалений

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

@ -1010,9 +1010,9 @@ nsresult MediaPipelineTransmit::SetTrack(RefPtr<MediaStreamTrack> aDomTrack) {
mSendPort = nullptr;
}
if (aDomTrack && mDomTrack && !aDomTrack->Ended() && !mDomTrack->Ended() &&
aDomTrack->Graph() != mDomTrack->Graph() && mSendTrack) {
// Recreate the send track if the new stream resides in different MTG.
if (aDomTrack && !aDomTrack->Ended() && mSendTrack &&
aDomTrack->Graph() != mSendTrack->Graph()) {
// Recreate the send track if the new stream resides in a different MTG.
// Stopping and re-starting will result in removing and re-adding the
// listener BUT in different threads, since tracks belong to different MTGs.
// This can create thread races so we wait here for the stop to happen