Title: [172025] trunk/Source/WebCore
Revision
172025
Author
[email protected]
Date
2014-08-04 20:57:27 -0700 (Mon, 04 Aug 2014)

Log Message

[MSE] Videos will report a stall when within 1 frame-duration before the end of a movie.
https://bugs.webkit.org/show_bug.cgi?id=135586

Reviewed by Eric Carlson.

Under certain circumstances, videos which are within 1/24 seconds before the end of a media stream when
monitorSourceBuffers() is called will fail the hasFutureTime() check. This is because hasFutureTime()
checks whether enough media is buffered to play back at least some time in the future, but when the
current time is close to the duration, not enough data is buffered to satisfy that check.

Add some logic which will break out early when the SourceBuffer has buffered up to and including the
media's duration, and return that the buffer indeed hasFutureTime() available.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::hasFutureTime):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (172024 => 172025)


--- trunk/Source/WebCore/ChangeLog	2014-08-05 03:40:55 UTC (rev 172024)
+++ trunk/Source/WebCore/ChangeLog	2014-08-05 03:57:27 UTC (rev 172025)
@@ -1,3 +1,21 @@
+2014-08-04  Jer Noble  <[email protected]>
+
+        [MSE] Videos will report a stall when within 1 frame-duration before the end of a movie.
+        https://bugs.webkit.org/show_bug.cgi?id=135586
+
+        Reviewed by Eric Carlson.
+
+        Under certain circumstances, videos which are within 1/24 seconds before the end of a media stream when
+        monitorSourceBuffers() is called will fail the hasFutureTime() check. This is because hasFutureTime()
+        checks whether enough media is buffered to play back at least some time in the future, but when the
+        current time is close to the duration, not enough data is buffered to satisfy that check.
+
+        Add some logic which will break out early when the SourceBuffer has buffered up to and including the
+        media's duration, and return that the buffer indeed hasFutureTime() available.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::hasFutureTime):
+
 2014-08-04  Benjamin Poulain  <[email protected]>
 
         Simplify the StyleInvalidation mode of rule collection

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (172024 => 172025)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2014-08-05 03:40:55 UTC (rev 172024)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2014-08-05 03:57:27 UTC (rev 172025)
@@ -1495,8 +1495,12 @@
     if (found == notFound)
         return false;
 
-    bool ignoredValid = false;
-    return ranges->end(found, ignoredValid) - currentTime > currentTimeFudgeFactor();
+    MediaTime localEnd = ranges->end(found);
+    MediaTime duration = MediaTime::createWithDouble(m_source->duration());
+    if (localEnd == duration)
+        return true;
+
+    return localEnd - currentTime > currentTimeFudgeFactor();
 }
 
 bool SourceBuffer::canPlayThrough()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to