souphttpsrc: don't fail when seeking past the end of the content

Range errors are already turned into EOS when the size is not known.
Do the same thing if the request as outside the known content size.

This can be triggered by seeking in a queue2:
- Ensure that the range containing the end of the file is available.
- Seek into this range from a different range.
- queue2 creates a seek event with start=<file-size>
- this results in a "Requested Range Not Satisfiable" error

Fixes #452

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/385>
This commit is contained in:
Michael Olbrich 2018-04-19 13:57:26 +02:00 committed by GStreamer Merge Bot
parent d4b50d7915
commit 83beb9211b

View file

@ -1417,7 +1417,8 @@ gst_soup_http_src_parse_status (SoupMessage * msg, GstSoupHTTPSrc * src)
* a body message, requests that go beyond the content limits will result
* in an error. Here we convert those to EOS */
if (msg->status_code == SOUP_STATUS_REQUESTED_RANGE_NOT_SATISFIABLE &&
src->have_body && !src->have_size) {
src->have_body && (!src->have_size ||
(src->request_position >= src->content_size))) {
GST_DEBUG_OBJECT (src, "Requested range out of limits and received full "
"body, returning EOS");
return GST_FLOW_EOS;