mirror of
https://gitee.com/openharmony/third_party_ffmpeg
synced 2024-11-23 19:30:05 +00:00
avformat/cache: Use the correct io handle in seeking
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
dedd3c89ae
commit
7018d3d351
@ -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)
|
static int64_t cache_seek(URLContext *h, int64_t pos, int whence)
|
||||||
{
|
{
|
||||||
Context *c= h->priv_data;
|
Context *c= h->priv_data;
|
||||||
|
int64_t ret;
|
||||||
|
|
||||||
if (whence == AVSEEK_SIZE) {
|
if (whence == AVSEEK_SIZE) {
|
||||||
pos= ffurl_seek(c->inner, pos, whence);
|
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
|
//cache miss
|
||||||
pos = lseek(c->fd, pos, whence);
|
ret= ffurl_seek(c->inner, pos, whence);
|
||||||
if (pos >= 0) {
|
|
||||||
c->logical_pos = pos;
|
if (ret >= 0) {
|
||||||
c->end = FFMAX(c->end, pos);
|
c->logical_pos = ret;
|
||||||
|
c->end = FFMAX(c->end, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
return pos;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cache_close(URLContext *h)
|
static int cache_close(URLContext *h)
|
||||||
|
Loading…
Reference in New Issue
Block a user