From 83beb9211bb9c475998d6e2a6ce8fb339d63f109 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Thu, 19 Apr 2018 13:57:26 +0200 Subject: [PATCH] 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= - this results in a "Requested Range Not Satisfiable" error Fixes #452 Part-of: --- ext/soup/gstsouphttpsrc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 6547291..a899222 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -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; -- 2.7.4