diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-04 20:36:48 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-08-25 23:01:53 +0200 |
commit | 7cfff1512c41a95f50a020854d40c813b9a8b1ec (patch) | |
tree | 7b8ce0903614034bf230fec407424a8ebd0a0f15 /libavformat | |
parent | 81b61869207782d71b55d1a262dab340fc2d94cf (diff) |
avformat/aviobuf: Avoid calling function twice due to FFMAX()
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/aviobuf.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c index 66fddf1433..164b07ae6a 100644 --- a/libavformat/aviobuf.c +++ b/libavformat/aviobuf.c @@ -274,8 +274,10 @@ int64_t avio_seek(AVIOContext *s, int64_t offset, int whence) return AVERROR(EINVAL); short_seek = s->short_seek_threshold; - if (s->short_seek_get) - short_seek = FFMAX(s->short_seek_get(s->opaque), short_seek); + if (s->short_seek_get) { + int tmp = s->short_seek_get(s->opaque); + short_seek = FFMAX(tmp, 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); |