зеркало из https://github.com/mozilla/gecko-dev.git
Bug 922601. Use StreamTimeToGraphTime to get the correct conversion to graph time. r=padenot
--HG-- extra : rebase_source : 148da9b3fdc1cd6fb12489ad20d724218fcd75d1
This commit is contained in:
Родитель
e6675fbb2f
Коммит
2cbed1975a
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче