Bug 1189506. Remove MediaStream::mBlockInThisPhase. r=karlt

This commit is contained in:
Robert O'Callahan 2015-09-04 16:57:32 +12:00
parent 6ca95977cc
commit 8e7b013812
3 changed files with 6 additions and 22 deletions

View File

@ -734,21 +734,13 @@ MediaStreamGraphImpl::RecomputeBlocking(GraphTime aEndBlockingDecisions)
mStateComputedTime = aEndBlockingDecisions;
}
void
MediaStreamGraphImpl::MarkStreamBlocking(MediaStream* aStream)
{
if (aStream->mBlockInThisPhase)
return;
aStream->mBlockInThisPhase = true;
}
void
MediaStreamGraphImpl::RecomputeBlockingAt(MediaStream* aStream,
GraphTime aTime,
GraphTime aEndBlockingDecisions,
GraphTime* aEnd)
{
aStream->mBlockInThisPhase = false;
bool block = false;
do {
if (aStream->mFinished) {
@ -757,7 +749,7 @@ MediaStreamGraphImpl::RecomputeBlockingAt(MediaStream* aStream,
if (endTime <= aTime) {
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is blocked due to being finished", aStream));
// We'll block indefinitely
MarkStreamBlocking(aStream);
block = true;
*aEnd = std::min(*aEnd, aEndBlockingDecisions);
continue;
} else {
@ -773,20 +765,20 @@ MediaStreamGraphImpl::RecomputeBlockingAt(MediaStream* aStream,
*aEnd = std::min(*aEnd, end);
if (explicitBlock) {
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is blocked due to explicit blocker", aStream));
MarkStreamBlocking(aStream);
block = true;
continue;
}
if (aStream->IsSuspended()) {
STREAM_LOG(LogLevel::Verbose, ("MediaStream %p is blocked due to being suspended", aStream));
MarkStreamBlocking(aStream);
block = true;
continue;
}
bool underrun = WillUnderrun(aStream, aTime, aEndBlockingDecisions, aEnd);
if (underrun) {
// We'll block indefinitely
MarkStreamBlocking(aStream);
block = true;
*aEnd = std::min(*aEnd, aEndBlockingDecisions);
continue;
}
@ -794,7 +786,7 @@ MediaStreamGraphImpl::RecomputeBlockingAt(MediaStream* aStream,
NS_ASSERTION(*aEnd > aTime, "Failed to advance!");
aStream->mBlocked.SetAtAndAfter(aTime, aStream->mBlockInThisPhase);
aStream->mBlocked.SetAtAndAfter(aTime, block);
}
void

View File

@ -717,8 +717,6 @@ protected:
// True if the stream is being consumed (i.e. has track data being played,
// or is feeding into some stream that is being consumed).
bool mIsConsumed;
// True if this stream should be blocked in this phase.
bool mBlockInThisPhase;
// This state is only used on the main thread.
DOMMediaStream* mWrapper;

View File

@ -304,12 +304,6 @@ public:
*/
void RecomputeBlocking(GraphTime aEndBlockingDecisions);
/**
* Mark a stream blocked at time aTime. If this results in decisions that need
* to be revisited at some point in the future, *aEnd will be reduced to the
* first time in the future to recompute those decisions.
*/
void MarkStreamBlocking(MediaStream* aStream);
/**
* Recompute blocking for the streams in aStreams for the interval starting at aTime.
* If this results in decisions that need to be revisited at some point