mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 882543 - Actually run offline MSG offline. r=roc
This commit is contained in:
parent
77d11314c9
commit
3a1bbd5d18
@ -313,20 +313,30 @@ MediaStreamGraphImpl::GetAudioPosition(MediaStream* aStream)
|
||||
void
|
||||
MediaStreamGraphImpl::UpdateCurrentTime()
|
||||
{
|
||||
GraphTime prevCurrentTime = mCurrentTime;
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
GraphTime nextCurrentTime =
|
||||
SecondsToMediaTime((now - mCurrentTimeStamp).ToSeconds()) + mCurrentTime;
|
||||
GraphTime prevCurrentTime, nextCurrentTime;
|
||||
if (mRealtime) {
|
||||
TimeStamp now = TimeStamp::Now();
|
||||
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) {
|
||||
LOG(PR_LOG_WARNING, ("Media graph global underrun detected"));
|
||||
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) {
|
||||
NS_ASSERTION(prevCurrentTime == nextCurrentTime, "Time can't go backwards!");
|
||||
|
Loading…
Reference in New Issue
Block a user