[FFmpeg-cvslog] avformat/dhav: Fix check for seekability

Andreas Rheinhardt git at videolan.org
Tue Jun 17 01:58:53 EEST 2025


ffmpeg | branch: master | Andreas Rheinhardt <andreas.rheinhardt at outlook.com> | Sun Jun  8 00:52:46 2025 +0200| [e3ba364c5ee9747f53c94904608a075cadd53042] | committer: Andreas Rheinhardt

avformat/dhav: Fix check for seekability

AVIOContext.seekable is a bitfield. Also check for seekability
earlier.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt at outlook.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e3ba364c5ee9747f53c94904608a075cadd53042
---

 libavformat/dhav.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/dhav.c b/libavformat/dhav.c
index c7e5371636..ffd6d66359 100644
--- a/libavformat/dhav.c
+++ b/libavformat/dhav.c
@@ -237,6 +237,9 @@ static void get_timeinfo(unsigned date, struct tm *timeinfo)
 
 static int64_t get_duration(AVFormatContext *s)
 {
+    if (!(s->pb->seekable & AVIO_SEEKABLE_NORMAL))
+        return 0;
+
     int64_t start_pos = avio_tell(s->pb);
     int64_t end_pos = -1;
     int64_t start = 0, end = 0;
@@ -248,9 +251,6 @@ static int64_t get_duration(AVFormatContext *s)
     unsigned date;
     int64_t size = avio_size(s->pb);
 
-    if (!s->pb->seekable)
-        return 0;
-
     if (start_pos + 16 > size)
         return 0;
 



More information about the ffmpeg-cvslog mailing list