summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian@centricular.com>2014-09-11 12:52:11 +0300
committerSebastian Dröge <sebastian@centricular.com>2014-09-11 12:57:06 +0300
commitc19bcb6c60b4cd6d4f48b2a5ac522ac31d2c0da2 (patch)
tree76901a40e5ef32a0d008567d7f0600044d93d53f
parent590985382f29464edb1cf7cce70aa6e14dbfff00 (diff)
souphttpsrc: If the server reports "Accept-Ranges: none" don't try range requests
-rw-r--r--ext/soup/gstsouphttpsrc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/soup/gstsouphttpsrc.c b/ext/soup/gstsouphttpsrc.c
index 35fa2de05..ad8722336 100644
--- a/ext/soup/gstsouphttpsrc.c
+++ b/ext/soup/gstsouphttpsrc.c
@@ -1034,6 +1034,7 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
GHashTable *params = NULL;
GstEvent *http_headers_event;
GstStructure *http_headers, *headers;
+ const gchar *accept_ranges;
GST_INFO_OBJECT (src, "got headers");
@@ -1098,6 +1099,16 @@ gst_soup_http_src_got_headers_cb (SoupMessage * msg, GstSoupHTTPSrc * src)
}
}
+ /* If the server reports Accept-Ranges: none we don't have to try
+ * doing range requests at all
+ */
+ if ((accept_ranges =
+ soup_message_headers_get_one (msg->response_headers,
+ "Accept-Ranges"))) {
+ if (g_ascii_strcasecmp (accept_ranges, "none") == 0)
+ src->seekable = FALSE;
+ }
+
/* Icecast stuff */
tag_list = gst_tag_list_new_empty ();