Bug 1608118 - Remove direct listeners from the source in ForwardedInputTrack when MediaInput is removed r=padenot

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alex Chronopoulos 2020-01-20 14:17:39 +00:00
Родитель 69f068dde7
Коммит 3fabc043bf
1 изменённых файлов: 9 добавлений и 0 удалений

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

@ -58,6 +58,15 @@ void ForwardedInputTrack::RemoveInput(MediaInputPort* aPort) {
TRACK_LOG(LogLevel::Debug,
("ForwardedInputTrack %p removing input %p", this, aPort));
MOZ_ASSERT(aPort == mInputPort);
for (const auto& listener : mOwnedDirectListeners) {
MediaTrack* source = mInputPort->GetSource();
TRACK_LOG(LogLevel::Debug,
("ForwardedInputTrack %p removing direct listener "
"%p. Forwarding to input track %p.",
this, listener.get(), aPort->GetSource()));
source->RemoveDirectListenerImpl(listener);
}
mInputPort = nullptr;
ProcessedMediaTrack::RemoveInput(aPort);
}