Bug 1404997 - P16. Properly finish the SourceMediaStream during shutdown. r?padenot draft
authorJean-Yves Avenard <jyavenard@mozilla.com>
Thu, 07 Dec 2017 20:20:53 +0100
changeset 712536 79903fd09cec285b0eb998527076d27d8abf94a4
parent 712535 064013ea0b78add5d22c892d3a401c31614bc878
child 712537 d89cbf39c2a4afc642567c8bba4684e302e1bcf8
push id93357
push userbmo:jyavenard@mozilla.com
push dateSun, 17 Dec 2017 09:29:04 +0000
reviewerspadenot
bugs1404997, 1410829
milestone59.0a1
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
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