Bug 1172394 - Forward direct listeners to all inputs over a ForwardedInputTrack's lifetime. r=padenot

This was not needed when inputs to a ForwardedInputTrack could not come and go,
but they can now. This keeps direct listeners for a ForwardedInputTrack around
until it ends, as that's the terminal state where we know we can no longer
process another input.

Depends on D52049

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Andreas Pehrson 2019-11-14 14:56:00 +00:00
Родитель cdbd8a12f8
Коммит 44d40679ec
1 изменённых файлов: 4 добавлений и 5 удалений

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

@ -60,11 +60,6 @@ void ForwardedInputTrack::RemoveInput(MediaInputPort* aPort) {
TRACK_LOG(LogLevel::Debug,
("ForwardedInputTrack %p removing input %p", this, aPort));
MOZ_ASSERT(aPort == mInputPort);
nsTArray<RefPtr<DirectMediaTrackListener>> listeners(mOwnedDirectListeners);
for (const auto& listener : listeners) {
// Remove listeners while the entry still exists.
RemoveDirectListenerImpl(listener);
}
mInputPort = nullptr;
ProcessedMediaTrack::RemoveInput(aPort);
}
@ -163,6 +158,10 @@ void ForwardedInputTrack::ProcessInput(GraphTime aFrom, GraphTime aTo,
} else {
MOZ_CRASH("Unknown segment type");
}
if (mEnded) {
RemoveAllDirectListenersImpl();
}
}
void ForwardedInputTrack::SetEnabledImpl(DisabledTrackMode aMode) {