You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-10 06:10:52 +02:00
cache: Fallback to using the cache size for AVSEEK_SIZE if the underlaying protocol has nothing better.
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -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);
|
||||||
|
Reference in New Issue
Block a user