Bug 1189506. No need to pass aNextCurrentTime to UpdateCurrentTimeForStreams. r=karlt

--HG--
extra : commitid : LUQBrLpUxAE
extra : rebase_source : f170667a03f21b1a42852890b61bd43875edc47a
This commit is contained in:
Robert O'Callahan 2015-09-05 00:42:53 +12:00
Родитель ebcc8535cb
Коммит cb09439d97
2 изменённых файлов: 7 добавлений и 9 удалений

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

@ -296,12 +296,11 @@ MediaStreamGraphImpl::StreamReadyToFinish(MediaStream* aStream)
} }
void void
MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime, MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime)
GraphTime aNextCurrentTime)
{ {
for (MediaStream* stream : AllStreams()) { for (MediaStream* stream : AllStreams()) {
// Calculate blocked time and fire Blocked/Unblocked events // Calculate blocked time and fire Blocked/Unblocked events
GraphTime blockedTime = aNextCurrentTime - stream->mStartBlocking; GraphTime blockedTime = mStateComputedTime - stream->mStartBlocking;
NS_ASSERTION(blockedTime >= 0, "Error in blocking time"); NS_ASSERTION(blockedTime >= 0, "Error in blocking time");
if (stream->mStartBlocking > aPrevCurrentTime && stream->mNotifiedBlocked) { if (stream->mStartBlocking > aPrevCurrentTime && stream->mNotifiedBlocked) {
@ -311,7 +310,7 @@ MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime,
} }
stream->mNotifiedBlocked = false; stream->mNotifiedBlocked = false;
} }
if (stream->mStartBlocking < aNextCurrentTime && !stream->mNotifiedBlocked) { if (stream->mStartBlocking < mStateComputedTime && !stream->mNotifiedBlocked) {
for (uint32_t j = 0; j < stream->mListeners.Length(); ++j) { for (uint32_t j = 0; j < stream->mListeners.Length(); ++j) {
MediaStreamListener* l = stream->mListeners[j]; MediaStreamListener* l = stream->mListeners[j];
l->NotifyBlockingChanged(this, MediaStreamListener::BLOCKED); l->NotifyBlockingChanged(this, MediaStreamListener::BLOCKED);
@ -319,7 +318,7 @@ MediaStreamGraphImpl::UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime,
stream->mNotifiedBlocked = true; stream->mNotifiedBlocked = true;
} }
stream->AdvanceTimeVaryingValuesToCurrentTime(aNextCurrentTime, stream->AdvanceTimeVaryingValuesToCurrentTime(mStateComputedTime,
blockedTime); blockedTime);
STREAM_LOG(LogLevel::Verbose, STREAM_LOG(LogLevel::Verbose,
@ -1262,7 +1261,7 @@ MediaStreamGraphImpl::OneIteration(GraphTime aStateEnd)
mProcessedTime = stateEnd; mProcessedTime = stateEnd;
UpdateCurrentTimeForStreams(stateFrom, stateEnd); UpdateCurrentTimeForStreams(stateFrom);
return UpdateMainThreadState(); return UpdateMainThreadState();
} }

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

@ -221,10 +221,9 @@ public:
bool ShouldUpdateMainThread(); bool ShouldUpdateMainThread();
// The following methods are the various stages of RunThread processing. // The following methods are the various stages of RunThread processing.
/** /**
* Advance all stream state to the new current time. * Advance all stream state to mStateComputedTime.
*/ */
void UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime, void UpdateCurrentTimeForStreams(GraphTime aPrevCurrentTime);
GraphTime aNextCurrentTime);
/** /**
* Process graph message for this iteration, update stream processing order, * Process graph message for this iteration, update stream processing order,
* and recompute stream blocking until aEndBlockingDecisions. * and recompute stream blocking until aEndBlockingDecisions.