зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1453127 - Clear output streams on shutdown. r=jya
This commit is contained in:
Родитель
6c6e70fcbc
Коммит
9d5b27393d
|
@ -3448,6 +3448,10 @@ MediaDecoderStateMachine::FinishDecodeFirstFrame()
|
|||
RefPtr<ShutdownPromise>
|
||||
MediaDecoderStateMachine::BeginShutdown()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
if (mOutputStreamManager) {
|
||||
mOutputStreamManager->Clear();
|
||||
}
|
||||
return InvokeAsync(OwnerThread(), this, __func__,
|
||||
&MediaDecoderStateMachine::Shutdown);
|
||||
}
|
||||
|
|
|
@ -125,6 +125,13 @@ OutputStreamManager::Remove(MediaStream* aStream)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
OutputStreamManager::Clear()
|
||||
{
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
mStreams.Clear();
|
||||
}
|
||||
|
||||
TrackID
|
||||
OutputStreamManager::NextAvailableTrackIDFor(MediaStream* aOutputStream) const
|
||||
{
|
||||
|
|
|
@ -59,6 +59,8 @@ public:
|
|||
bool aFinishWhenEnded);
|
||||
// Remove the output stream from the collection.
|
||||
void Remove(MediaStream* aStream);
|
||||
// Clear all output streams from the collection.
|
||||
void Clear();
|
||||
// The next TrackID that will not cause a collision in aOutputStream.
|
||||
TrackID NextAvailableTrackIDFor(MediaStream* aOutputStream) const;
|
||||
// Return true if the collection empty.
|
||||
|
|
Загрузка…
Ссылка в новой задаче