Repository navigation
[GStreamer] Use Content-Range to get the resource size when Content-L… - #1737
Open
petartijanic01 wants to merge 1 commit into
Open
petartijanic01 wants to merge 1 commit into
petartijanic01 wants to merge 1 commit into
Conversation
…ength is missing A server can answer a progressive media request with 206 Partial Content and a Content-Range header but without Content-Length, for example when the body is sent with chunked transfer encoding. The total size is then only available as the instance length in Content-Range, for example "bytes 0-25059330/25059331". WebKitWebSource took the size only from Content-Length, so such a resource was reported as having no size and not being seekable. MediaPlayerPrivateGStreamer found no Content-Length in the response headers either and set m_isLiveStream. maxTimeSeekable() then returned zero, seekable() was empty and HTMLMediaElement ignored every seek. When Content-Length is missing, take the total size from a valid Content-Range in both places. This fixes the HbbTV test org.hbbtv_HTML52090, where a seek to an unbuffered position in a progressive MP4 must issue a Range request. * Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): * Source/WebCore/platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived):
eocanha
self-requested a review
October 23, 2026 12:12
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…ength is missing
A server can answer a progressive media request with 206 Partial Content and
Content-Range but without Content-Length (e.g. chunked transfer encoding). The
total size is then only available in Content-Range ("bytes 0-25059330/25059331").
WebKitWebSource took the size only from Content-Length, so the resource was
reported as unseekable with no size, and MediaPlayerPrivateGStreamer set
m_isLiveStream. seekable() was empty and every seek was ignored
("ignored seek to ...").
This change takes the total size from a valid Content-Range when Content-Length
is missing, in both places. Responses with Content-Length and live streams
without Content-Range are not affected.
Fixes HbbTV test org.hbbtv_HTML52090 (seek to an unbuffered position in a
progressive MP4 must issue a Range request).
Testing: a server answering 206 + Content-Range, chunked, without
Content-Length. Before: the seek is ignored and no new request is made.
After: the seek issues "Range: bytes=14404095-" and playback continues from
the seek position.
a02cf70