Bug 845741: Set mUpdateFinished under lock r=roc

This commit is contained in:
Randell Jesup 2013-04-08 08:03:33 -04:00
parent bb2bea552c
commit a15d1c6211

View File

@ -1748,6 +1748,7 @@ SourceMediaStream::AdvanceKnownTracksTime(StreamTime aKnownTime)
void
SourceMediaStream::FinishWithLockHeld()
{
mMutex.AssertCurrentThreadOwns();
mUpdateFinished = true;
if (!mDestroyed) {
GraphImpl()->EnsureNextIteration();
@ -1757,12 +1758,10 @@ SourceMediaStream::FinishWithLockHeld()
void
SourceMediaStream::EndAllTrackAndFinish()
{
{
MutexAutoLock lock(mMutex);
for (uint32_t i = 0; i < mUpdateTracks.Length(); ++i) {
SourceMediaStream::TrackData* data = &mUpdateTracks[i];
data->mCommands |= TRACK_END;
}
MutexAutoLock lock(mMutex);
for (uint32_t i = 0; i < mUpdateTracks.Length(); ++i) {
SourceMediaStream::TrackData* data = &mUpdateTracks[i];
data->mCommands |= TRACK_END;
}
FinishWithLockHeld();
// we will call NotifyFinished() to let GetUserMedia know