b=1022945 only AppendToTrack before SourceMediaStreams are destroyed r=roc

--HG--
extra : rebase_source : 016877261fb7a10b6d99abd17a8ca26b222d38c4
This commit is contained in:
Karl Tomlinson 2014-07-25 09:23:59 +12:00
Родитель 2b3a4e189d
Коммит 44362049aa
1 изменённых файлов: 3 добавлений и 4 удалений

Просмотреть файл

@ -2416,7 +2416,8 @@ SourceMediaStream::AppendToTrack(TrackID aID, MediaSegment* aSegment, MediaSegme
MutexAutoLock lock(mMutex); MutexAutoLock lock(mMutex);
// ::EndAllTrackAndFinished() can end these before the sources notice // ::EndAllTrackAndFinished() can end these before the sources notice
bool appended = false; bool appended = false;
if (!mFinished) { auto graph = GraphImpl();
if (!mFinished && graph) {
TrackData *track = FindDataForTrack(aID); TrackData *track = FindDataForTrack(aID);
if (track) { if (track) {
// Data goes into mData, and on the next iteration of the MSG moves // 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); NotifyDirectConsumers(track, aRawSegment ? aRawSegment : aSegment);
track->mData->AppendFrom(aSegment); // note: aSegment is now dead track->mData->AppendFrom(aSegment); // note: aSegment is now dead
appended = true; appended = true;
graph->EnsureNextIteration();
} else { } else {
aSegment->Clear(); aSegment->Clear();
} }
} }
if (auto graph = GraphImpl()) {
graph->EnsureNextIteration();
}
return appended; return appended;
} }