aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRodger Combs <rodger.combs@gmail.com>2015-04-13 00:39:44 -0500
committerMichael Niedermayer <michaelni@gmx.at>2015-04-13 11:18:50 +0200
commita4d58c97d0513904313638a913e2d985be47d3df (patch)
tree4399f86c30970aadb8abe06487047325656f8dc3
parentf7f71b5795d708763eb0c55fe5e2cb051b2b69f4 (diff)
downloadffmpeg-a4d58c97d0513904313638a913e2d985be47d3df.tar.gz
lavf/http: handle case where the server returns a redirect during a seek
txoffer (e.g. http://tori.aoi-chan.com/ ) redirects to the same URI on your first request, and serves the actual file on the second. It's stupid, but AFAIK technically compliant. We'd previously see the server not handing back a Range header and return an error; now, instead, we see that there's a redirect and keep track of the offset we want while trying again at the new URL. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/http.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index b2293da81f..bbe5de5cf1 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -917,6 +917,9 @@ static int http_connect(URLContext *h, const char *path, const char *local_path,
if (err < 0)
goto done;
+ if (*new_location)
+ s->off = off;
+
err = (off == s->off) ? 0 : -1;
done:
av_freep(&authstr);