Bug 922601. Use StreamTimeToGraphTime to get the correct conversion to graph time. r=padenot

--HG--
extra : rebase_source : 148da9b3fdc1cd6fb12489ad20d724218fcd75d1
This commit is contained in:
Robert O'Callahan 2013-10-01 22:28:49 -04:00
Родитель e6675fbb2f
Коммит 2cbed1975a
1 изменённых файлов: 15 добавлений и 8 удалений

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

@ -347,6 +347,7 @@ MediaStreamGraphImpl::UpdateCurrentTime()
// listeners that streams have ended still needs to run.
}
nsTArray<MediaStream*> streamsReadyToFinish;
for (uint32_t i = 0; i < mStreams.Length(); ++i) {
MediaStream* stream = mStreams[i];
@ -382,8 +383,20 @@ MediaStreamGraphImpl::UpdateCurrentTime()
}
}
if (stream->mFinished && !stream->mNotifiedFinished &&
stream->mBufferStartTime + stream->GetBufferEnd() <= nextCurrentTime) {
if (stream->mFinished && !stream->mNotifiedFinished) {
streamsReadyToFinish.AppendElement(stream);
}
LOG(PR_LOG_DEBUG+1, ("MediaStream %p bufferStartTime=%f blockedTime=%f",
stream, MediaTimeToSeconds(stream->mBufferStartTime),
MediaTimeToSeconds(blockedTime)));
}
mCurrentTime = nextCurrentTime;
// Do this after setting mCurrentTime so that StreamTimeToGraphTime works properly.
for (uint32_t i = 0; i < streamsReadyToFinish.Length(); ++i) {
MediaStream* stream = streamsReadyToFinish[i];
if (StreamTimeToGraphTime(stream, stream->GetBufferEnd()) <= mCurrentTime) {
stream->mNotifiedFinished = true;
stream->mLastPlayedVideoFrame.SetNull();
for (uint32_t j = 0; j < stream->mListeners.Length(); ++j) {
@ -391,13 +404,7 @@ MediaStreamGraphImpl::UpdateCurrentTime()
l->NotifyFinished(this);
}
}
LOG(PR_LOG_DEBUG+1, ("MediaStream %p bufferStartTime=%f blockedTime=%f",
stream, MediaTimeToSeconds(stream->mBufferStartTime),
MediaTimeToSeconds(blockedTime)));
}
mCurrentTime = nextCurrentTime;
}
bool