From: Stefan Fritsch Date: Sun, 4 Sep 2011 08:56:24 +0000 (+0200) Subject: http: Consider the stream as seekable if the reply contains Accept-Ranges: bytes X-Git-Tag: v0.8b1~1627 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=346ea9e22240b4442f479518f6c3b40c9bec9487;p=platform%2Fupstream%2Flibav.git http: Consider the stream as seekable if the reply contains Accept-Ranges: bytes The initial request contains "Range: 0-", which servers normally have responded with "HTTP/1.1 206 Partial Content" reply with a Content-Range header, which was used as indicator for seekability. Apache, since 2.2.20, responds with "HTTP/1.1 200 OK" for these requests, which is more friendly to caches and proxies, but the seekability still is indicated via the Accept-Ranges: bytes header. Signed-off-by: Martin Storsjö --- diff --git a/libavformat/http.c b/libavformat/http.c index aa8c665..a20bfdf 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -265,6 +265,8 @@ static int process_line(URLContext *h, char *line, int line_count, s->filesize = atoll(slash+1); } h->is_streamed = 0; /* we _can_ in fact seek */ + } else if (!strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5)) { + h->is_streamed = 0; } else if (!strcasecmp (tag, "Transfer-Encoding") && !strncasecmp(p, "chunked", 7)) { s->filesize = -1; s->chunksize = 0;