diff options
author | Edward Hervey <edward@centricular.com> | 2017-11-08 16:34:01 +0100 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2017-11-09 09:42:42 +0100 |
commit | 93e11cf3c2fb09c49de3abb0dd05a7ef1647f356 (patch) | |
tree | 84a70befaebad7a79a8693eba558ec9d286d1424 | |
parent | 75a59474c699c92b1446365845758aef77afa1b2 (diff) | |
download | gstreamer-plugins-good-93e11cf3c2fb09c49de3abb0dd05a7ef1647f356.tar.gz |
souphttpsrc: Fix seeking back to 0
This is a regression introduced by "03db374 - 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.
-rw-r--r-- | ext/soup/gstsouphttpsrc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index 2d08e135f..288b609f1 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -1458,6 +1458,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; |