Title: [264085] releases/WebKitGTK/webkit-2.28
Revision
264085
Author
[email protected]
Date
2020-07-08 03:07:31 -0700 (Wed, 08 Jul 2020)

Log Message

Merge r261165 - [GStreamer] Video loops when ran in rr record --chaos
https://bugs.webkit.org/show_bug.cgi?id=211182

Reviewed by Philippe Normand.

Source/WebCore:

While trying to investigate a different bug, I ran the browser with
`rr record --chaos`, which makes it run very slowly and shuffles
thread scheduling to try to make existing race conditions more likely
to show up, also inevitably making the software run very slow.

Doing so I found something strange: the video kept looping even though
it didn't have the `loop` attribute set.

After some debugging I found that MediaPlayer decides if the video has
ended in part by checking `currentMediaTime()` is greater or equal to
the video duration, which was not guaranteed to be the case in
MediaPlayerPrivateGStreamer.

As a consequence of this patch, one new LayoutTest has passed.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):

LayoutTests:

imported/w3c/web-platform-tests/media-source/mediasource-getvideoplaybackquality.html
is now passing.

* platform/gtk/TestExpectations:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog (264084 => 264085)


--- releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog	2020-07-08 10:07:25 UTC (rev 264084)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog	2020-07-08 10:07:31 UTC (rev 264085)
@@ -1,3 +1,15 @@
+2020-05-05  Alicia Boya García  <[email protected]>
+
+        [GStreamer] Video loops when ran in rr record --chaos
+        https://bugs.webkit.org/show_bug.cgi?id=211182
+
+        Reviewed by Philippe Normand.
+
+        imported/w3c/web-platform-tests/media-source/mediasource-getvideoplaybackquality.html
+        is now passing.
+
+        * platform/gtk/TestExpectations:
+
 2020-04-27  Alicia Boya García  <[email protected]>
 
         [GStreamer] Rework WebKitWebSrc threading

Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/platform/gtk/TestExpectations (264084 => 264085)


--- releases/WebKitGTK/webkit-2.28/LayoutTests/platform/gtk/TestExpectations	2020-07-08 10:07:25 UTC (rev 264084)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/platform/gtk/TestExpectations	2020-07-08 10:07:31 UTC (rev 264085)
@@ -1424,7 +1424,6 @@
 webkit.org/b/203078 imported/w3c/web-platform-tests/media-source/mediasource-remove.html [ Pass Crash ]
 webkit.org/b/203078 media/media-source/media-source-remove-unload-crash.html [ Pass Crash ]
 webkit.org/b/203078 media/media-source/media-source-seek-detach-crash.html [ Pass Crash ]
-webkit.org/b/203078 imported/w3c/web-platform-tests/media-source/mediasource-getvideoplaybackquality.html [ Failure Crash ]
 webkit.org/b/203078 imported/w3c/web-platform-tests/media-source/mediasource-replay.html [ Failure Crash ]
 webkit.org/b/203078 imported/w3c/web-platform-tests/media-source/mediasource-seek-during-pending-seek.html [ Pass Crash ]
 webkit.org/b/203078 imported/w3c/web-platform-tests/media-source/mediasource-redundant-seek.html [ Pass Crash ]

Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog (264084 => 264085)


--- releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog	2020-07-08 10:07:25 UTC (rev 264084)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/ChangeLog	2020-07-08 10:07:31 UTC (rev 264085)
@@ -1,3 +1,28 @@
+2020-05-05  Alicia Boya García  <[email protected]>
+
+        [GStreamer] Video loops when ran in rr record --chaos
+        https://bugs.webkit.org/show_bug.cgi?id=211182
+
+        Reviewed by Philippe Normand.
+
+        While trying to investigate a different bug, I ran the browser with
+        `rr record --chaos`, which makes it run very slowly and shuffles
+        thread scheduling to try to make existing race conditions more likely
+        to show up, also inevitably making the software run very slow.
+
+        Doing so I found something strange: the video kept looping even though
+        it didn't have the `loop` attribute set.
+
+        After some debugging I found that MediaPlayer decides if the video has
+        ended in part by checking `currentMediaTime()` is greater or equal to
+        the video duration, which was not guaranteed to be the case in
+        MediaPlayerPrivateGStreamer.
+
+        As a consequence of this patch, one new LayoutTest has passed.
+
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
+
 2020-04-29  Alicia Boya García  <[email protected]>
 
         PlatformMediaResourceLoader should be destroyed on the main thread

Modified: releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (264084 => 264085)


--- releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-07-08 10:07:25 UTC (rev 264084)
+++ releases/WebKitGTK/webkit-2.28/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-07-08 10:07:31 UTC (rev 264085)
@@ -1626,8 +1626,10 @@
 MediaTime MediaPlayerPrivateGStreamer::playbackPosition() const
 {
     GST_TRACE_OBJECT(pipeline(), "isEndReached: %s, seeking: %s, seekTime: %s", boolForPrinting(m_isEndReached), boolForPrinting(m_isSeeking), m_seekTime.toString().utf8().data());
-    if (m_isEndReached && m_isSeeking)
+    if (m_isSeeking)
         return m_seekTime;
+    if (m_isEndReached)
+        return m_playbackRate > 0 ? durationMediaTime() : MediaTime::zeroTime();
 
     // This constant should remain lower than HTMLMediaElement's maxTimeupdateEventFrequency.
     static const Seconds positionCacheThreshold = 200_ms;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to