Bug 1404997 - P15. Properly finish the SourceMediaStream during shutdown. r?padenot draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 07 Dec 2017 20:20:53 +0100
changeset 710545 793b4b41965ab21c0ef431b37a22a86b57978f0f
parent 710544 61e92f222e03b6ac4f8f5c775db1a1eaf1725742
child 710546 2e3efebc483104a074bced1bcf9d26ce16146a47
push id92845
push userbmo:jyavenard@mozilla.com
push dateSun, 10 Dec 2017 22:43:10 +0000
reviewerspadenot
bugs1404997, 1410829
milestone59.0a1
Bug 1404997 - P15. 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
dom/media/MediaStreamGraph.cpp
--- 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