aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas George <george@nsup.org>2019-07-19 14:21:49 +0200
committerNicolas George <george@nsup.org>2019-08-13 15:38:57 +0200
commit6e1a2dc11236fb04acf35bde647872eb4f3ded9c (patch)
tree70e3a806117604f1fb73960d82a34567cc1d7d00
parent2b4c1a0f3cdbdfd4f02509a513d4e4bdd12e955d (diff)
downloadffmpeg-6e1a2dc11236fb04acf35bde647872eb4f3ded9c.tar.gz
lavf/aviobuf: make AVSEEK_SIZE usable from outside.
-rw-r--r--libavformat/aviobuf.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 2d011027c9..c76df714ad 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -255,6 +255,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
if(!s)
return AVERROR(EINVAL);
+ if ((whence & AVSEEK_SIZE))
+ return s->seek ? s->seek(s->opaque, offset, AVSEEK_SIZE) : AVERROR(ENOSYS);
+
buffer_size = s->buf_end - s->buffer;
// pos is the absolute position that the beginning of s->buffer corresponds to in the file
pos = s->pos - (s->write_flag ? 0 : buffer_size);