diff mbox

[FFmpeg-devel,1/2] avformat/aviobuf: Remove dead check

Message ID 20190514084949.57498-1-andreas.rheinhardt@gmail.com
State New
Headers show

Commit Message

Andreas Rheinhardt May 14, 2019, 8:49 a.m. UTC
avio_seek only accepts SEEK_CUR and SEEK_SET (possibly OR'ed with
AVSEEK_FORCE) as whence parameter. Therefore the check
"whence != SEEK_END || force" is always true and can be removed.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
---
 libavformat/aviobuf.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
diff mbox

Patch

diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index 5a33f82950..5c01423a2e 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -290,8 +290,7 @@  int64_t avio_seek(AVIOContext *s, int64_t offset, int whence)
     } else if ((!(s->seekable & AVIO_SEEKABLE_NORMAL) ||
                offset1 <= buffer_size + short_seek) &&
                !s->write_flag && offset1 >= 0 &&
-               (!s->direct || !s->seek) &&
-              (whence != SEEK_END || force)) {
+               (!s->direct || !s->seek)) {
         while(s->pos < offset && !s->eof_reached)
             fill_buffer(s);
         if (s->eof_reached)