Title: [261165] trunk
Revision
261165
Author
[email protected]
Date
2020-05-05 07:36:50 -0700 (Tue, 05 May 2020)

Log Message

[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: trunk/LayoutTests/ChangeLog (261164 => 261165)


--- trunk/LayoutTests/ChangeLog	2020-05-05 13:48:55 UTC (rev 261164)
+++ trunk/LayoutTests/ChangeLog	2020-05-05 14:36:50 UTC (rev 261165)
@@ -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-05-05  Antoine Quint  <[email protected]>
 
         Unreviewed, reverting r260989.

Modified: trunk/LayoutTests/platform/gtk/TestExpectations (261164 => 261165)


--- trunk/LayoutTests/platform/gtk/TestExpectations	2020-05-05 13:48:55 UTC (rev 261164)
+++ trunk/LayoutTests/platform/gtk/TestExpectations	2020-05-05 14:36:50 UTC (rev 261165)
@@ -1607,7 +1607,6 @@
 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-complete.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: trunk/Source/WebCore/ChangeLog (261164 => 261165)


--- trunk/Source/WebCore/ChangeLog	2020-05-05 13:48:55 UTC (rev 261164)
+++ trunk/Source/WebCore/ChangeLog	2020-05-05 14:36:50 UTC (rev 261165)
@@ -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-05-05  Zalan Bujtas  <[email protected]>
 
         [LFC] Rename computedContentHeight/Width to computedHeight/Width

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (261164 => 261165)


--- trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-05-05 13:48:55 UTC (rev 261164)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp	2020-05-05 14:36:50 UTC (rev 261165)
@@ -1387,8 +1387,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