Title: [291487] trunk/Source/WebCore
Revision
291487
Author
[email protected]
Date
2022-03-18 09:45:44 -0700 (Fri, 18 Mar 2022)

Log Message

[GStreamer] Add stop position to the range request
https://bugs.webkit.org/show_bug.cgi?id=238028

Reviewed by Philippe Normand.

Currently, the range requests performed by WebKitWebSourceGStreamer indicate a range
start position but not a range stop one, even though it's set in the internal
members->stopPosition attribute.

This may not be a problem when WebKitWebSrc is used as a source for the whole video,
but certainly is when it's used as an embedded source inside adaptive demux
(replacing SoupHttpSrc). It causes decoding errors in some MPEG-DASH streams.
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/813

This patch is authored by Eugene Mutavchi <[email protected]>
See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/814

* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: Apply stopPosition to the range request when it's valid.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (291486 => 291487)


--- trunk/Source/WebCore/ChangeLog	2022-03-18 15:39:27 UTC (rev 291486)
+++ trunk/Source/WebCore/ChangeLog	2022-03-18 16:45:44 UTC (rev 291487)
@@ -1,3 +1,24 @@
+2022-03-18  Enrique Ocaña González  <[email protected]>
+
+        [GStreamer] Add stop position to the range request
+        https://bugs.webkit.org/show_bug.cgi?id=238028
+
+        Reviewed by Philippe Normand.
+
+        Currently, the range requests performed by WebKitWebSourceGStreamer indicate a range
+        start position but not a range stop one, even though it's set in the internal
+        members->stopPosition attribute.
+
+        This may not be a problem when WebKitWebSrc is used as a source for the whole video,
+        but certainly is when it's used as an embedded source inside adaptive demux
+        (replacing SoupHttpSrc). It causes decoding errors in some MPEG-DASH streams.
+        See: https://github.com/WebPlatformForEmbedded/WPEWebKit/issues/813
+
+        This patch is authored by Eugene Mutavchi <[email protected]>
+        See: https://github.com/WebPlatformForEmbedded/WPEWebKit/pull/814
+
+        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: Apply stopPosition to the range request when it's valid.
+
 2022-03-18  Youenn Fablet  <[email protected]>
 
         REGRESSION(r290356-r290351?): [ iOS EWS ] 3 imported/w3c/web-platform-tests/service-workers/service-worker/* tests are constant text failures.

Modified: trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp (291486 => 291487)


--- trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2022-03-18 15:39:27 UTC (rev 291486)
+++ trunk/Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp	2022-03-18 16:45:44 UTC (rev 291487)
@@ -674,8 +674,12 @@
         || !g_ascii_strcasecmp("trailers.apple.com", url.host().utf8().data()))
         request.setHTTPUserAgent("Quicktime/7.6.6");
 
-    if (members->requestedPosition) {
-        GUniquePtr<char> formatedRange(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", members->requestedPosition));
+    if (members->requestedPosition || members->stopPosition != UINT64_MAX) {
+        GUniquePtr<char> formatedRange;
+        if (members->stopPosition != UINT64_MAX)
+            formatedRange.reset(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-%" G_GUINT64_FORMAT, members->requestedPosition, members->stopPosition > 0 ? members->stopPosition - 1 : 0));
+        else
+            formatedRange.reset(g_strdup_printf("bytes=%" G_GUINT64_FORMAT "-", members->requestedPosition));
         GST_DEBUG_OBJECT(src, "Range request: %s", formatedRange.get());
         request.setHTTPHeaderField(HTTPHeaderName::Range, formatedRange.get());
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to