зеркало из https://github.com/mozilla/gecko-dev.git
Bug 882543 - Actually run offline MSG offline. r=roc
This commit is contained in:
Родитель
63bc0bcbc6
Коммит
9959f0b02d
|
@ -313,20 +313,30 @@ MediaStreamGraphImpl::GetAudioPosition(MediaStream* aStream)
|
||||||
void
|
void
|
||||||
MediaStreamGraphImpl::UpdateCurrentTime()
|
MediaStreamGraphImpl::UpdateCurrentTime()
|
||||||
{
|
{
|
||||||
GraphTime prevCurrentTime = mCurrentTime;
|
GraphTime prevCurrentTime, nextCurrentTime;
|
||||||
TimeStamp now = TimeStamp::Now();
|
if (mRealtime) {
|
||||||
GraphTime nextCurrentTime =
|
TimeStamp now = TimeStamp::Now();
|
||||||
SecondsToMediaTime((now - mCurrentTimeStamp).ToSeconds()) + mCurrentTime;
|
prevCurrentTime = mCurrentTime;
|
||||||
|
nextCurrentTime =
|
||||||
|
SecondsToMediaTime((now - mCurrentTimeStamp).ToSeconds()) + mCurrentTime;
|
||||||
|
|
||||||
|
mCurrentTimeStamp = now;
|
||||||
|
LOG(PR_LOG_DEBUG+1, ("Updating current time to %f (real %f, mStateComputedTime %f)",
|
||||||
|
MediaTimeToSeconds(nextCurrentTime),
|
||||||
|
(now - mInitialTimeStamp).ToSeconds(),
|
||||||
|
MediaTimeToSeconds(mStateComputedTime)));
|
||||||
|
} else {
|
||||||
|
prevCurrentTime = mCurrentTime;
|
||||||
|
nextCurrentTime = mCurrentTime + MEDIA_GRAPH_TARGET_PERIOD_MS;
|
||||||
|
LOG(PR_LOG_DEBUG+1, ("Updating offline current time to %f (mStateComputedTime %f)",
|
||||||
|
MediaTimeToSeconds(nextCurrentTime),
|
||||||
|
MediaTimeToSeconds(mStateComputedTime)));
|
||||||
|
}
|
||||||
|
|
||||||
if (mStateComputedTime < nextCurrentTime) {
|
if (mStateComputedTime < nextCurrentTime) {
|
||||||
LOG(PR_LOG_WARNING, ("Media graph global underrun detected"));
|
LOG(PR_LOG_WARNING, ("Media graph global underrun detected"));
|
||||||
nextCurrentTime = mStateComputedTime;
|
nextCurrentTime = mStateComputedTime;
|
||||||
}
|
}
|
||||||
mCurrentTimeStamp = now;
|
|
||||||
|
|
||||||
LOG(PR_LOG_DEBUG+1, ("Updating current time to %f (real %f, mStateComputedTime %f)",
|
|
||||||
MediaTimeToSeconds(nextCurrentTime),
|
|
||||||
(now - mInitialTimeStamp).ToSeconds(),
|
|
||||||
MediaTimeToSeconds(mStateComputedTime)));
|
|
||||||
|
|
||||||
if (prevCurrentTime >= nextCurrentTime) {
|
if (prevCurrentTime >= nextCurrentTime) {
|
||||||
NS_ASSERTION(prevCurrentTime == nextCurrentTime, "Time can't go backwards!");
|
NS_ASSERTION(prevCurrentTime == nextCurrentTime, "Time can't go backwards!");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче