Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
| ... | ... |
@@ -95,7 +95,14 @@ static int64_t cache_seek(URLContext *h, int64_t pos, int whence) |
| 95 | 95 |
Context *c= h->priv_data; |
| 96 | 96 |
|
| 97 | 97 |
if (whence == AVSEEK_SIZE) {
|
| 98 |
- return ffurl_seek(c->inner, pos, whence); |
|
| 98 |
+ pos= ffurl_seek(c->inner, pos, whence); |
|
| 99 |
+ if(pos <= 0){
|
|
| 100 |
+ pos= ffurl_seek(c->inner, -1, SEEK_END); |
|
| 101 |
+ ffurl_seek(c->inner, c->end, SEEK_SET); |
|
| 102 |
+ if(pos <= 0) |
|
| 103 |
+ return c->end; |
|
| 104 |
+ } |
|
| 105 |
+ return pos; |
|
| 99 | 106 |
} |
| 100 | 107 |
|
| 101 | 108 |
pos= lseek(c->fd, pos, whence); |