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);
// ::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;
}