diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-06-03 18:34:53 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-06-28 00:18:24 +0200 |
commit | 7803a040419f7abb82310fb02a109f6a411650d6 (patch) | |
tree | 365c765b9177917a9eb03bef3df1fe12d1cf19df /libavformat | |
parent | d1c74ca2bee269ef5da4069d3d3617d8e503731e (diff) | |
download | ffmpeg-7803a040419f7abb82310fb02a109f6a411650d6.tar.gz |
http: try to detect live akamai streams and dont enable seeking for them
Fixes ticket1320
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/http.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavformat/http.c b/libavformat/http.c index 0314557b2c..5355bdc68d 100644 --- a/libavformat/http.c +++ b/libavformat/http.c @@ -56,6 +56,7 @@ typedef struct { int multiple_requests; /**< A flag which indicates if we use persistent connections. */ uint8_t *post_data; int post_datalen; + int is_akamai; } HTTPContext; #define OFFSET(x) offsetof(HTTPContext, x) @@ -317,7 +318,8 @@ static int process_line(URLContext *h, char *line, int line_count, if ((slash = strchr(p, '/')) && strlen(slash) > 0) s->filesize = strtoll(slash+1, NULL, 10); } - h->is_streamed = 0; /* we _can_ in fact seek */ + if (!s->is_akamai || s->filesize != 2147483647) + h->is_streamed = 0; /* we _can_ in fact seek */ } else if (!av_strcasecmp(tag, "Accept-Ranges") && !strncmp(p, "bytes", 5)) { h->is_streamed = 0; } else if (!av_strcasecmp (tag, "Transfer-Encoding") && !av_strncasecmp(p, "chunked", 7)) { @@ -332,6 +334,8 @@ static int process_line(URLContext *h, char *line, int line_count, } else if (!av_strcasecmp (tag, "Connection")) { if (!strcmp(p, "close")) s->willclose = 1; + } else if (!av_strcasecmp (tag, "Server") && !av_strcasecmp (p, "AkamaiGHost")) { + s->is_akamai = 1; } } return 1; |