Commit 02b651a7 authored by Michael Niedermayer's avatar Michael Niedermayer

cache: Fallback to using the cache size for AVSEEK_SIZE if the underlaying...

cache: Fallback to using the cache size for AVSEEK_SIZE if the underlaying protocol has nothing better.
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent e9f62a8b
...@@ -95,7 +95,14 @@ static int64_t cache_seek(URLContext *h, int64_t pos, int whence) ...@@ -95,7 +95,14 @@ static int64_t cache_seek(URLContext *h, int64_t pos, int whence)
Context *c= h->priv_data; Context *c= h->priv_data;
if (whence == AVSEEK_SIZE) { if (whence == AVSEEK_SIZE) {
return ffurl_seek(c->inner, pos, whence); pos= ffurl_seek(c->inner, pos, whence);
if(pos <= 0){
pos= ffurl_seek(c->inner, -1, SEEK_END);
ffurl_seek(c->inner, c->end, SEEK_SET);
if(pos <= 0)
return c->end;
}
return pos;
} }
pos= lseek(c->fd, pos, whence); pos= lseek(c->fd, pos, whence);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment