Commit 770bb07f authored by Edward Hervey's avatar Edward Hervey 🤘 Committed by Edward Hervey

souphttpsrc: Fix seeking back to 0

This is a regression introduced by "03db3741 - souphttpsrc: retry
request on early termination from the server"

The problem was that when seeking back to 0, we would not end up calling
add_range_header() which in addition to adding range headers *ALSO* sets
the read_position to the requested one.

This would result in a wide variety of later failures, like reading
again and again instead of stopping properly.
parent 5dd39d89
......@@ -1582,6 +1582,12 @@ gst_soup_http_src_do_request (GstSoupHTTPSrc * src, const gchar * method)
src->stop_position);
}
/* add_range_header() has the side effect of setting read_position to
* the requested position. This *needs* to be set regardless of having
* a message or not. Failure to do so would result in calculation being
* done with stale/wrong read position */
src->read_position = src->request_position;
if (!src->msg) {
if (!gst_soup_http_src_build_message (src, method)) {
return GST_FLOW_ERROR;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment