Skip to content
Snippets Groups Projects
Commit 02b651a7 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

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: default avatarMichael Niedermayer <michaelni@gmx.at>
parent e9f62a8b
No related branches found
No related tags found
No related merge requests found
...@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment