summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-02 18:40:53 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-11 13:42:06 +0200
commit4e640f05605f19a377c2ae9cc27effb53f83cf4f (patch)
treeea95cb81545e017a33d3277c969ff8a061555d01 /libavformat/aviobuf.c
parent70af8a5efb238b0c7a4a220facd8083455e9857d (diff)
avformat/avio: move short seek threshold to the context
This allows us to adjust it internally. Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 45400cd01d..dfefe62ecd 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -97,6 +97,7 @@ int ffio_init_context(AVIOContext *s,
s->seekable = seek ? AVIO_SEEKABLE_NORMAL : 0;
s->max_packet_size = 0;
s->update_checksum = NULL;
+ s->short_seek_threshold = SHORT_SEEK_THRESHOLD;
if (!read_packet && !write_flag) {
s->pos = buffer_size;
@@ -232,7 +233,7 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
/* can do the seek inside the buffer */
s->buf_ptr = s->buffer + offset1;
} else if ((!s->seekable ||
- offset1 <= s->buf_end + SHORT_SEEK_THRESHOLD - s->buffer) &&
+ offset1 <= s->buf_end + s->short_seek_threshold - s->buffer) &&
!s->write_flag && offset1 >= 0 &&
(!s->direct || !s->seek) &&
(whence != SEEK_END || force)) {