summaryrefslogtreecommitdiff
path: root/libavformat/http.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-09-23 15:26:56 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2012-09-23 15:40:17 +0200
commit033f53fb8f4c095e8d465e90325bc4521c4ddca6 (patch)
tree0f606553808eb965b71e2c2d5fc9023b19d21bc6 /libavformat/http.c
parent3905caf25115f7728416e82b13deadd22ff2f19b (diff)
downloadffmpeg-033f53fb8f4c095e8d465e90325bc4521c4ddca6.tar.gz
Document why we always send a Range HTTP header.
Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
Diffstat (limited to 'libavformat/http.c')
-rw-r--r--libavformat/http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index 85ed7a5c81..ede4e8b6f6 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -411,6 +411,9 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
if (!has_header(s->headers, "\r\nAccept: "))
len += av_strlcpy(headers + len, "Accept: */*\r\n",
sizeof(headers) - len);
+ // Note: we send this on purpose even when s->off is 0,
+ // since it allows us to detect more reliably if a (non-conforming)
+ // server supports seeking by analysing the reply headers.
if (!has_header(s->headers, "\r\nRange: ") && !post)
len += av_strlcatf(headers + len, sizeof(headers) - len,
"Range: bytes=%"PRId64"-\r\n", s->off);