Commit 6e1a2dc1 authored by Nicolas George's avatar Nicolas George

lavf/aviobuf: make AVSEEK_SIZE usable from outside.

parent 2b4c1a0f
...@@ -255,6 +255,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) ...@@ -255,6 +255,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
if(!s) if(!s)
return AVERROR(EINVAL); 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; buffer_size = s->buf_end - s->buffer;
// pos is the absolute position that the beginning of s->buffer corresponds to in the file // 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); pos = s->pos - (s->write_flag ? 0 : buffer_size);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment