summaryrefslogtreecommitdiff
path: root/libavformat/aviobuf.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavformat/aviobuf.c')
-rw-r--r--libavformat/aviobuf.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 78cc60b2ae..518cb11129 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -283,13 +283,9 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
if (offset < 0)
return AVERROR(EINVAL);
- if (s->short_seek_get) {
- short_seek = s->short_seek_get(s->opaque);
- /* fallback to default short seek */
- if (short_seek <= 0)
- short_seek = s->short_seek_threshold;
- } else
- short_seek = s->short_seek_threshold;
+ short_seek = s->short_seek_threshold;
+ if (s->short_seek_get)
+ short_seek = FFMAX(s->short_seek_get(s->opaque), short_seek);
offset1 = offset - pos; // "offset1" is the relative offset from the beginning of s->buffer
s->buf_ptr_max = FFMAX(s->buf_ptr_max, s->buf_ptr);