mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 05:41:12 +00:00
Bug 1280445 - Clear out all MediaSegments directly on forced MediaStreamGraph shutdown. r=jesup
MozReview-Commit-ID: 3nDPEAAJABw --HG-- extra : rebase_source : 9bda288ff3dc7382671e365ada7d88c23fc6c50f extra : source : 43ecb11eccfb4c2bce62b5dc0e3a6c1ddc19609a
This commit is contained in:
parent
e028368c0f
commit
f40d583675
@ -1694,6 +1694,15 @@ public:
|
||||
// delete it.
|
||||
NS_ASSERTION(mGraph->mForceShutDown || !mGraph->mRealtime,
|
||||
"Not in forced shutdown?");
|
||||
for (MediaStream* stream : mGraph->AllStreams()) {
|
||||
// Clean up all MediaSegments since we cannot release Images too
|
||||
// late during shutdown.
|
||||
if (SourceMediaStream* source = stream->AsSourceStream()) {
|
||||
// Finishing a SourceStream prevents new data from being appended.
|
||||
source->Finish();
|
||||
}
|
||||
stream->GetStreamTracks().Clear();
|
||||
}
|
||||
|
||||
mGraph->mLifecycleState =
|
||||
MediaStreamGraphImpl::LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION;
|
||||
|
@ -108,4 +108,10 @@ StreamTracks::ForgetUpTo(StreamTime aTime)
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
StreamTracks::Clear()
|
||||
{
|
||||
mTracks.Clear();
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
@ -302,6 +302,11 @@ public:
|
||||
* Can't be used to forget beyond GetEnd().
|
||||
*/
|
||||
void ForgetUpTo(StreamTime aTime);
|
||||
/**
|
||||
* Clears out all Tracks and the data they are holding.
|
||||
* MediaStreamGraph calls this during forced shutdown.
|
||||
*/
|
||||
void Clear();
|
||||
/**
|
||||
* Returns the latest time passed to ForgetUpTo.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user