diff mbox series

[FFmpeg-devel] avformat/avio: fixed AVSEEK_FORCE and documentation

Message ID 20210524044651.6718-1-val.zapod.vz@gmail.com
State Superseded
Headers show
Series [FFmpeg-devel] avformat/avio: fixed AVSEEK_FORCE and documentation | expand

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Valerii Zapodovnikov May 24, 2021, 4:46 a.m. UTC
Always true expression: we would have returned on line 265.
Because of short curcuiting force will never be checked.
---
 libavformat/avio.h    | 1 -
 libavformat/aviobuf.c | 3 +--
 2 files changed, 1 insertion(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/libavformat/avio.h b/libavformat/avio.h
index d022820a6e..8bc00e3f3f 100644
--- a/libavformat/avio.h
+++ b/libavformat/avio.h
@@ -534,7 +534,6 @@  void avio_write_marker(AVIOContext *s, int64_t time, enum AVIODataMarkerType typ
  * Passing this flag as the "whence" parameter to a seek function causes it to
  * seek by any means (like reopening and linear reading) or other normally unreasonable
  * means that can be extremely slow.
- * This may be ignored by the seek code.
  */
 #define AVSEEK_FORCE 0x20000
 
diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c
index ddfa4ecbf1..d748cda397 100644
--- a/libavformat/aviobuf.c
+++ b/libavformat/aviobuf.c
@@ -286,8 +286,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) || force) {
         while(s->pos < offset && !s->eof_reached)
             fill_buffer(s);
         if (s->eof_reached)