Title: [206209] trunk
Revision
206209
Author
jer.no...@apple.com
Date
2016-09-21 09:13:57 -0700 (Wed, 21 Sep 2016)

Log Message

[media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html
https://bugs.webkit.org/show_bug.cgi?id=162257

Reviewed by Eric Carlson.

Source/WebCore:

Some of the conditions in the track changed methods were reversed, and all failed to schedule
a change event.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::videoTrackSelectedChanged):
(WebCore::SourceBuffer::audioTrackEnabledChanged):
(WebCore::SourceBuffer::textTrackModeChanged):

LayoutTests:

* platform/mac/TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (206208 => 206209)


--- trunk/LayoutTests/ChangeLog	2016-09-21 16:12:33 UTC (rev 206208)
+++ trunk/LayoutTests/ChangeLog	2016-09-21 16:13:57 UTC (rev 206209)
@@ -1,3 +1,12 @@
+2016-09-19  Jer Noble  <jer.no...@apple.com>
+
+        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html
+        https://bugs.webkit.org/show_bug.cgi?id=162257
+
+        Reviewed by Eric Carlson.
+
+        * platform/mac/TestExpectations:
+
 2016-09-20  Jer Noble  <jer.no...@apple.com>
 
         [media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html

Modified: trunk/LayoutTests/platform/mac/TestExpectations (206208 => 206209)


--- trunk/LayoutTests/platform/mac/TestExpectations	2016-09-21 16:12:33 UTC (rev 206208)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2016-09-21 16:13:57 UTC (rev 206209)
@@ -1044,6 +1044,7 @@
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/SourceBuffer-abort.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/URL-createObjectURL.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html [ Pass ]
+[ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer-mode.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-addsourcebuffer.html [ Pass ]
 [ Yosemite+ ] imported/w3c/web-platform-tests/media-source/mediasource-appendwindow.html [ Pass ]

Modified: trunk/Source/WebCore/ChangeLog (206208 => 206209)


--- trunk/Source/WebCore/ChangeLog	2016-09-21 16:12:33 UTC (rev 206208)
+++ trunk/Source/WebCore/ChangeLog	2016-09-21 16:13:57 UTC (rev 206209)
@@ -1,3 +1,18 @@
+2016-09-19  Jer Noble  <jer.no...@apple.com>
+
+        [media-source] Fix imported/w3c/web-platform-tests/media-source/mediasource-activesourcebuffers.html
+        https://bugs.webkit.org/show_bug.cgi?id=162257
+
+        Reviewed by Eric Carlson.
+
+        Some of the conditions in the track changed methods were reversed, and all failed to schedule
+        a change event.
+
+        * Modules/mediasource/SourceBuffer.cpp:
+        (WebCore::SourceBuffer::videoTrackSelectedChanged):
+        (WebCore::SourceBuffer::audioTrackEnabledChanged):
+        (WebCore::SourceBuffer::textTrackModeChanged):
+
 2016-09-20  Jer Noble  <jer.no...@apple.com>
 
         [media-source] Fix imported/w3c/web-platform-tests/media-source/URL-createObjectURL-null.html

Modified: trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp (206208 => 206209)


--- trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2016-09-21 16:12:33 UTC (rev 206208)
+++ trunk/Source/WebCore/Modules/mediasource/SourceBuffer.cpp	2016-09-21 16:13:57 UTC (rev 206209)
@@ -1695,7 +1695,7 @@
     // If the selected video track changes, then run the following steps:
     // 1. If the SourceBuffer associated with the previously selected video track is not associated with
     // any other enabled tracks, run the following steps:
-    if (track->selected()
+    if (!track->selected()
         && (!m_videoTracks || !m_videoTracks->isAnyTrackEnabled())
         && (!m_audioTracks || !m_audioTracks->isAnyTrackEnabled())
         && (!m_textTracks || !m_textTracks->isAnyTrackEnabled())) {
@@ -1702,7 +1702,7 @@
         // 1.1 Remove the SourceBuffer from activeSourceBuffers.
         // 1.2 Queue a task to fire a simple event named removesourcebuffer at activeSourceBuffers
         setActive(false);
-    } else if (!track->selected()) {
+    } else if (track->selected()) {
         // 2. If the SourceBuffer associated with the newly selected video track is not already in activeSourceBuffers,
         // run the following steps:
         // 2.1 Add the SourceBuffer to activeSourceBuffers.
@@ -1710,6 +1710,9 @@
         setActive(true);
     }
 
+    if (m_videoTracks && m_videoTracks->contains(*track))
+        m_videoTracks->scheduleChangeEvent();
+
     if (!isRemoved())
         m_source->mediaElement()->videoTrackSelectedChanged(track);
 }
@@ -1719,7 +1722,7 @@
     // 2.4.5 Changes to selected/enabled track state
     // If an audio track becomes disabled and the SourceBuffer associated with this track is not
     // associated with any other enabled or selected track, then run the following steps:
-    if (track->enabled()
+    if (!track->enabled()
         && (!m_videoTracks || !m_videoTracks->isAnyTrackEnabled())
         && (!m_audioTracks || !m_audioTracks->isAnyTrackEnabled())
         && (!m_textTracks || !m_textTracks->isAnyTrackEnabled())) {
@@ -1726,7 +1729,7 @@
         // 1. Remove the SourceBuffer associated with the audio track from activeSourceBuffers
         // 2. Queue a task to fire a simple event named removesourcebuffer at activeSourceBuffers
         setActive(false);
-    } else if (!track->enabled()) {
+    } else if (track->enabled()) {
         // If an audio track becomes enabled and the SourceBuffer associated with this track is
         // not already in activeSourceBuffers, then run the following steps:
         // 1. Add the SourceBuffer associated with the audio track to activeSourceBuffers
@@ -1734,6 +1737,9 @@
         setActive(true);
     }
 
+    if (m_audioTracks && m_audioTracks->contains(*track))
+        m_audioTracks->scheduleChangeEvent();
+
     if (!isRemoved())
         m_source->mediaElement()->audioTrackEnabledChanged(track);
 }
@@ -1758,6 +1764,9 @@
         setActive(true);
     }
 
+    if (m_textTracks && m_textTracks->contains(*track))
+        m_textTracks->scheduleChangeEvent();
+
     if (!isRemoved())
         m_source->mediaElement()->textTrackModeChanged(track);
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to