Bug 1404997 - P16. Properly finish the SourceMediaStream during shutdown. r?padenot
Despite the name of the function, the original SourceMediaStream::Finish() (consequently renamed FinishPending) didn't actually finished the stream, but instead set a bool that would indicate to completely finish the stream once ExtractPendingInput ran. But here it could never run again.
So actually do what the original fix intended to do (
bug 1410829)
MozReview-Commit-ID: 1hHiOLiovG
--- a/dom/media/MediaStreamGraph.cpp
+++ b/dom/media/MediaStreamGraph.cpp
@@ -1452,17 +1452,17 @@ public:
// mGraph's thread is not running so it's OK to do whatever here
for (MediaStream* stream : mGraph->AllStreams()) {
// Clean up all MediaSegments since we cannot release Images too
// late during shutdown. Also notify listeners that they were removed
// so they can clean up any gfx resources.
if (SourceMediaStream* source = stream->AsSourceStream()) {
// Finishing a SourceStream prevents new data from being appended.
- source->FinishPending();
+ source->FinishOnGraphThread();
}
stream->GetStreamTracks().Clear();
stream->RemoveAllListenersImpl();
}
mGraph->mForceShutdownTicket = nullptr;
// We can't block past the final LIFECYCLE_WAITING_FOR_STREAM_DESTRUCTION