Title: [276701] releases/WebKitGTK/webkit-2.32
- Revision
- 276701
- Author
- [email protected]
- Date
- 2021-04-28 02:36:43 -0700 (Wed, 28 Apr 2021)
Log Message
Merge r275821 - [MSE][GStreamer] Crash in WebCore::PlaybackPipeline::addSourceBuffer when setting duration and preload is set to none
https://bugs.webkit.org/show_bug.cgi?id=224260
Patch by Philippe Normand <[email protected]> on 2021-04-12
Reviewed by Xabier Rodriguez-Calvar.
Source/WebCore:
Disable delayed loading for the GStreamer MSE player, we want the MSE source element to be
configured ASAP, otherwise the playback pipeline will fail in various ways (duration
notifications sent too early, crashes in addSourceBuffer, crashes in attachTracks, and so
on).
Test: media/media-source/media-source-no-preload-set-duration-crash.html
* platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
(WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
LayoutTests:
* media/media-source/media-source-no-preload-set-duration-crash-expected.txt: Added.
* media/media-source/media-source-no-preload-set-duration-crash.html: Added.
Modified Paths
Added Paths
Diff
Modified: releases/WebKitGTK/webkit-2.32/LayoutTests/ChangeLog (276700 => 276701)
--- releases/WebKitGTK/webkit-2.32/LayoutTests/ChangeLog 2021-04-28 09:32:34 UTC (rev 276700)
+++ releases/WebKitGTK/webkit-2.32/LayoutTests/ChangeLog 2021-04-28 09:36:43 UTC (rev 276701)
@@ -1,3 +1,13 @@
+2021-04-12 Philippe Normand <[email protected]>
+
+ [MSE][GStreamer] Crash in WebCore::PlaybackPipeline::addSourceBuffer when setting duration and preload is set to none
+ https://bugs.webkit.org/show_bug.cgi?id=224260
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ * media/media-source/media-source-no-preload-set-duration-crash-expected.txt: Added.
+ * media/media-source/media-source-no-preload-set-duration-crash.html: Added.
+
2021-03-24 Philippe Normand <[email protected]>
REGRESSION(r274870) fast/canvas/webgl/texImage2D-mse-flipY-true.html and fast/canvas/webgl/texImage2D-mse-flipY-false.html are crashing
Added: releases/WebKitGTK/webkit-2.32/LayoutTests/media/media-source/media-source-no-preload-set-duration-crash-expected.txt (0 => 276701)
--- releases/WebKitGTK/webkit-2.32/LayoutTests/media/media-source/media-source-no-preload-set-duration-crash-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.32/LayoutTests/media/media-source/media-source-no-preload-set-duration-crash-expected.txt 2021-04-28 09:36:43 UTC (rev 276701)
@@ -0,0 +1,9 @@
+
+RUN(video.src = ""
+EVENT(sourceopen)
+Setting duration when preload is disabled should trigger no crash.
+RUN(source.duration = 42)
+Adding a SourceBuffer when preload is disabled should trigger no crash.
+RUN(sourceBuffer = source.addSourceBuffer(loader.type()))
+END OF TEST
+
Added: releases/WebKitGTK/webkit-2.32/LayoutTests/media/media-source/media-source-no-preload-set-duration-crash.html (0 => 276701)
--- releases/WebKitGTK/webkit-2.32/LayoutTests/media/media-source/media-source-no-preload-set-duration-crash.html (rev 0)
+++ releases/WebKitGTK/webkit-2.32/LayoutTests/media/media-source/media-source-no-preload-set-duration-crash.html 2021-04-28 09:36:43 UTC (rev 276701)
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>media-source-no-preload-set-duration-crash</title>
+ <script src=""
+ <script src=""
+ <script>
+ var loader;
+ var source;
+
+ function runTest() {
+ findMediaElement();
+
+ loader = new MediaSourceLoader('content/test-fragmented-manifest.json');
+ loader._onload_ = mediaDataLoaded;
+ }
+
+ function mediaDataLoaded() {
+ source = new MediaSource();
+ waitForEvent('sourceopen', sourceOpen, false, false, source);
+ run('video.src = ""
+ }
+
+ function sourceOpen() {
+ consoleWrite('Setting duration when preload is disabled should trigger no crash.');
+ run('source.duration = 42');
+ consoleWrite('Adding a SourceBuffer when preload is disabled should trigger no crash.');
+ run('sourceBuffer = source.addSourceBuffer(loader.type())');
+ endTest();
+ }
+ </script>
+</head>
+<body _onload_="runTest()">
+ <video preload="none"></video>
+</body>
+</html>
Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog (276700 => 276701)
--- releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog 2021-04-28 09:32:34 UTC (rev 276700)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/ChangeLog 2021-04-28 09:36:43 UTC (rev 276701)
@@ -1,3 +1,20 @@
+2021-04-12 Philippe Normand <[email protected]>
+
+ [MSE][GStreamer] Crash in WebCore::PlaybackPipeline::addSourceBuffer when setting duration and preload is set to none
+ https://bugs.webkit.org/show_bug.cgi?id=224260
+
+ Reviewed by Xabier Rodriguez-Calvar.
+
+ Disable delayed loading for the GStreamer MSE player, we want the MSE source element to be
+ configured ASAP, otherwise the playback pipeline will fail in various ways (duration
+ notifications sent too early, crashes in addSourceBuffer, crashes in attachTracks, and so
+ on).
+
+ Test: media/media-source/media-source-no-preload-set-duration-crash.html
+
+ * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
+ (WebCore::MediaPlayerPrivateGStreamerMSE::durationChanged):
+
2021-04-16 Adrian Perez de Castro <[email protected]>
Unreviewed non-unified build fix.
Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp (276700 => 276701)
--- releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2021-04-28 09:32:34 UTC (rev 276700)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp 2021-04-28 09:36:43 UTC (rev 276701)
@@ -356,7 +356,7 @@
setPlaybinURL(url);
GST_DEBUG_OBJECT(pipeline(), "preload: %s", convertEnumerationToString(m_preload).utf8().data());
- if (m_preload == MediaPlayer::Preload::None) {
+ if (m_preload == MediaPlayer::Preload::None && !isMediaSource()) {
GST_INFO_OBJECT(pipeline(), "Delaying load.");
m_isDelayingLoad = true;
}
Modified: releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.cpp (276700 => 276701)
--- releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.cpp 2021-04-28 09:32:34 UTC (rev 276700)
+++ releases/WebKitGTK/webkit-2.32/Source/WebCore/platform/graphics/gstreamer/mse/PlaybackPipeline.cpp 2021-04-28 09:36:43 UTC (rev 276701)
@@ -103,6 +103,7 @@
MediaSourcePrivate::AddStatus PlaybackPipeline::addSourceBuffer(RefPtr<SourceBufferPrivateGStreamer> sourceBufferPrivate)
{
+ ASSERT(m_webKitMediaSrc);
WebKitMediaSrcPrivate* priv = m_webKitMediaSrc->priv;
if (priv->allTracksConfigured) {
@@ -258,6 +259,7 @@
void PlaybackPipeline::notifyDurationChanged()
{
+ ASSERT(m_webKitMediaSrc);
gst_element_post_message(GST_ELEMENT(m_webKitMediaSrc.get()), gst_message_new_duration_changed(GST_OBJECT(m_webKitMediaSrc.get())));
// WebKitMediaSrc will ask MediaPlayerPrivateGStreamerMSE for the new duration later, when somebody asks for it.
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes