Bug 943461. Part 9: Handle absence of INCLUDE_TRAILING_BLOCKED_INTERVAL flag correctly. r=padenot
authorRobert O'Callahan <robert@ocallahan.org>
Mon, 09 Dec 2013 18:08:02 +1300
changeset 162326 4378e7bf2afcb67d47157c465666215b53ee6e12
parent 162325 9811231a9449a9aba1db0cc191f6e3eecdb27035
child 162327 bed75e8c44b1b5fd21f8b1257ffd486b7dea75b8
push idunknown
push userunknown
push dateunknown
reviewerspadenot
bugs943461
milestone29.0a1
Bug 943461. Part 9: Handle absence of INCLUDE_TRAILING_BLOCKED_INTERVAL flag correctly. r=padenot
content/media/MediaStreamGraph.cpp
--- a/content/media/MediaStreamGraph.cpp
+++ b/content/media/MediaStreamGraph.cpp
@@ -279,16 +279,19 @@ MediaStreamGraphImpl::StreamTimeToGraphT
     return aTime + aStream->mBufferStartTime;
   }
 
   MediaTime streamAmount = aTime - bufferElapsedToCurrentTime;
   NS_ASSERTION(streamAmount >= 0, "Can't answer queries before current time");
 
   GraphTime t = mCurrentTime;
   while (t < GRAPH_TIME_MAX) {
+    if (!(aFlags & INCLUDE_TRAILING_BLOCKED_INTERVAL) && streamAmount == 0) {
+      return t;
+    }
     bool blocked;
     GraphTime end;
     if (t < mStateComputedTime) {
       blocked = aStream->mBlocked.GetAt(t, &end);
       end = std::min(end, mStateComputedTime);
     } else {
       blocked = false;
       end = GRAPH_TIME_MAX;