diff options
author | Michael Olbrich <m.olbrich@pengutronix.de> | 2016-10-26 08:51:40 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2016-10-26 16:57:28 +0300 |
commit | 8666b7d871efac3647ff35470c6766b904387d3e (patch) | |
tree | 3c333d0128fa0bc2af906ed7e2a3215439a8f232 | |
parent | f6b2fc10ff7acc314bb46f233e3c9d924009b34c (diff) |
souphttpsrc: reset read_position when reading fails
souphttpsrc maintains two variables for the position:
* 'request_position' is where we want to be
* 'read_position' is where we are
During Normal operations both are updated in sync when data arrives. A seek
changes 'request_position' but not 'read_position'.
When the two positions get out of sync, then a new request is send and the
'Range' header is adjusted to the current 'request_position'.
Without this patch, if reading fails, then the source is destroyed. This
triggers a new request, but the range remains unchanged. As a result, the
old range is used and old data will be read.
Changing the 'read_position' to -1 makes it explicitly different from
'request_position' and as a result the 'Range' header is updated correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=773509
-rw-r--r-- | ext/soup/gstsouphttpsrc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c index aef64d321..a0475132b 100644 --- a/ext/soup/gstsouphttpsrc.c +++ b/ext/soup/gstsouphttpsrc.c @@ -1747,6 +1747,8 @@ done: gst_event_unref (http_headers_event); g_mutex_lock (&src->mutex); + /* Make sure the Range header is updated with the current position */ + src->read_position = -1; gst_soup_http_src_destroy_input_stream (src); g_mutex_unlock (&src->mutex); if (ret == GST_FLOW_CUSTOM_ERROR) |