Bug 750258 - include |nextCurrentTime| when calculating whether to call NotifyBlockingChanged(). r=roc

This commit is contained in:
JW Wang 2014-06-22 20:21:00 +02:00
parent bf65c4e5fc
commit b23c53b0d6

View File

@ -396,7 +396,9 @@ MediaStreamGraphImpl::UpdateCurrentTime()
// Calculate blocked time and fire Blocked/Unblocked events
GraphTime blockedTime = 0;
GraphTime t = prevCurrentTime;
while (t < nextCurrentTime) {
// include |nextCurrentTime| to ensure NotifyBlockingChanged() is called
// before NotifyFinished() when |nextCurrentTime == stream end time|
while (t <= nextCurrentTime) {
GraphTime end;
bool blocked = stream->mBlocked.GetAt(t, &end);
if (blocked) {
@ -451,6 +453,8 @@ MediaStreamGraphImpl::UpdateCurrentTime()
// out.
if (mCurrentTime >=
stream->StreamTimeToGraphTime(stream->GetStreamBuffer().GetAllTracksEnd())) {
NS_WARN_IF_FALSE(stream->mNotifiedBlocked,
"Should've notified blocked=true for a fully finished stream");
stream->mNotifiedFinished = true;
stream->mLastPlayedVideoFrame.SetNull();
SetStreamOrderDirty();