Title: [170543] trunk/Source/WebCore
Revision
170543
Author
[email protected]
Date
2014-06-27 11:45:00 -0700 (Fri, 27 Jun 2014)

Log Message

[MSE] http/tests/media/media-source/mediasource-append-buffer.html is failing
https://bugs.webkit.org/show_bug.cgi?id=134389

Reviewed by Eric Carlson.

Two subtests in mediasource-append-buffer.html are failing. Bring setDuration() up to spec
by throwing an exception if the duration is called while any SourceBuffer is updating. Do
not cancel pending events when a SourceBuffer is removed from its MediaSource. And mark the
SourceBuffer as having pending activity if there are pending events to be fired.

* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::setDuration):
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::removedFromMediaSource):
(WebCore::SourceBuffer::hasPendingActivity):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (170542 => 170543)


--- trunk/Source/WebCore/ChangeLog	2014-06-27 18:43:01 UTC (rev 170542)
+++ trunk/Source/WebCore/ChangeLog	2014-06-27 18:45:00 UTC (rev 170543)
@@ -1,3 +1,21 @@
+2014-06-27  Jer Noble  <[email protected]>
+
+        [MSE] http/tests/media/media-source/mediasource-append-buffer.html is failing
+        https://bugs.webkit.org/show_bug.cgi?id=134389
+
+        Reviewed by Eric Carlson.
+
+        Two subtests in mediasource-append-buffer.html are failing. Bring setDuration() up to spec
+        by throwing an exception if the duration is called while any SourceBuffer is updating. Do
+        not cancel pending events when a SourceBuffer is removed from its MediaSource. And mark the
+        SourceBuffer as having pending activity if there are pending events to be fired.
+
+        * Modules/mediasource/MediaSource.cpp:
+        (WebCore::MediaSource::setDuration):
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::removedFromMediaSource):
+        (WebCore::SourceBuffer::hasPendingActivity):
+
 2014-06-26  Simon Fraser  <[email protected]>
 
         [iOS WK2] Fix touch-scrollable elements with overflow:scroll on just one axis, and RTL scrolling

Modified: trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp (170542 => 170543)


--- trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp	2014-06-27 18:43:01 UTC (rev 170542)
+++ trunk/Source/WebCore/Modules/mediasource/MediaSource.cpp	2014-06-27 18:45:00 UTC (rev 170543)
@@ -252,14 +252,32 @@
 
 void MediaSource::setDuration(double duration, ExceptionCode& ec)
 {
+    // 2.1 Attributes - Duration
+    // https://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#attributes
+
+    // On setting, run the following steps:
+    // 1. If the value being set is negative or NaN then throw an INVALID_ACCESS_ERR exception and abort these steps.
     if (duration < 0.0 || std::isnan(duration)) {
         ec = INVALID_ACCESS_ERR;
         return;
     }
+
+    // 2. If the readyState attribute is not "open" then throw an INVALID_STATE_ERR exception and abort these steps.
     if (!isOpen()) {
         ec = INVALID_STATE_ERR;
         return;
     }
+
+    // 3. If the updating attribute equals true on any SourceBuffer in sourceBuffers, then throw an INVALID_STATE_ERR
+    // exception and abort these steps.
+    for (auto& sourceBuffer : *m_sourceBuffers) {
+        if (sourceBuffer->updating()) {
+            ec = INVALID_STATE_ERR;
+            return;
+        }
+    }
+
+    // 4. Run the duration change algorithm with new duration set to the value being assigned to this attribute.
     m_private->setDuration(MediaTime::createWithDouble(duration));
 }
 

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (170542 => 170543)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2014-06-27 18:43:01 UTC (rev 170542)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2014-06-27 18:45:00 UTC (rev 170543)
@@ -304,7 +304,6 @@
 
     m_private->removedFromMediaSource();
     m_source = 0;
-    m_asyncEventQueue.close();
 }
 
 void SourceBuffer::sourceBufferPrivateSeekToTime(SourceBufferPrivate*, const MediaTime& time)
@@ -392,7 +391,7 @@
 
 bool SourceBuffer::hasPendingActivity() const
 {
-    return m_source;
+    return m_source || m_asyncEventQueue.hasPendingEvents();
 }
 
 void SourceBuffer::stop()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to