From 44362049aa9a6819d9026ff8215b45b5984a0811 Mon Sep 17 00:00:00 2001 From: Karl Tomlinson Date: Fri, 25 Jul 2014 09:23:59 +1200 Subject: [PATCH] b=1022945 only AppendToTrack before SourceMediaStreams are destroyed r=roc --HG-- extra : rebase_source : 016877261fb7a10b6d99abd17a8ca26b222d38c4 --- content/media/MediaStreamGraph.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/content/media/MediaStreamGraph.cpp b/content/media/MediaStreamGraph.cpp index 3993ee93d79e..0706980fb1ef 100644 --- a/content/media/MediaStreamGraph.cpp +++ b/content/media/MediaStreamGraph.cpp @@ -2416,7 +2416,8 @@ SourceMediaStream::AppendToTrack(TrackID aID, MediaSegment* aSegment, MediaSegme MutexAutoLock lock(mMutex); // ::EndAllTrackAndFinished() can end these before the sources notice bool appended = false; - if (!mFinished) { + auto graph = GraphImpl(); + if (!mFinished && graph) { TrackData *track = FindDataForTrack(aID); if (track) { // Data goes into mData, and on the next iteration of the MSG moves @@ -2435,13 +2436,11 @@ SourceMediaStream::AppendToTrack(TrackID aID, MediaSegment* aSegment, MediaSegme NotifyDirectConsumers(track, aRawSegment ? aRawSegment : aSegment); track->mData->AppendFrom(aSegment); // note: aSegment is now dead appended = true; + graph->EnsureNextIteration(); } else { aSegment->Clear(); } } - if (auto graph = GraphImpl()) { - graph->EnsureNextIteration(); - } return appended; }