diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-12-25 21:30:10 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-12-25 22:07:32 +0100 |
commit | 7018d3d3510ee5be4fabd95b011373f9e826f897 (patch) | |
tree | 46a78b9d6246eaf3589111a67a837da789893cbc /libavformat/cache.c | |
parent | dedd3c89ae6a7983e5dcdeb5a37b268c08498a62 (diff) | |
download | ffmpeg-7018d3d3510ee5be4fabd95b011373f9e826f897.tar.gz |
avformat/cache: Use the correct io handle in seeking
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/cache.c')
-rw-r--r-- | libavformat/cache.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libavformat/cache.c b/libavformat/cache.c index ac9a8d2279..48a342f0ec 100644 --- a/libavformat/cache.c +++ b/libavformat/cache.c @@ -195,6 +195,7 @@ static int cache_read(URLContext *h, unsigned char *buf, int size) static int64_t cache_seek(URLContext *h, int64_t pos, int whence) { Context *c= h->priv_data; + int64_t ret; if (whence == AVSEEK_SIZE) { pos= ffurl_seek(c->inner, pos, whence); @@ -224,13 +225,14 @@ static int64_t cache_seek(URLContext *h, int64_t pos, int whence) } //cache miss - pos = lseek(c->fd, pos, whence); - if (pos >= 0) { - c->logical_pos = pos; - c->end = FFMAX(c->end, pos); + ret= ffurl_seek(c->inner, pos, whence); + + if (ret >= 0) { + c->logical_pos = ret; + c->end = FFMAX(c->end, ret); } - return pos; + return ret; } static int cache_close(URLContext *h) |