This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit cd3f3352074d532ec7421b47efe3496dc7d1de6b
Author:     Niklas Haas <[email protected]>
AuthorDate: Sun May 31 22:17:06 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Jun 4 17:48:12 2026 +0200

    avformat/file: return ENOSYS for filesize query on files with follow=1
    
    If the input is expected to grow, we shouldn't make any assumptions about
    the file size. This matches e.g. the behavior of streamed protocols like
    chunked HTTP, which similarly return ENOSYS for streams of unknown size.
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 doc/protocols.texi | 3 ++-
 libavformat/file.c | 3 +++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/doc/protocols.texi b/doc/protocols.texi
index a62156f4d8..81485bea12 100644
--- a/doc/protocols.texi
+++ b/doc/protocols.texi
@@ -343,7 +343,8 @@ time, which is valuable for files on slow medium.
 If set to 1, the protocol will retry reading at the end of the file, allowing
 reading files that still are being written. In order for this to terminate,
 you either need to use the rw_timeout option, or use the interrupt callback
-(for API users).
+(for API users). Setting this option also ignores the file size reported by
+the file system.
 
 @item seekable
 Controls if seekability is advertised on the file. 0 means non-seekable, -1
diff --git a/libavformat/file.c b/libavformat/file.c
index 3ceddc8c25..1bac50ac7f 100644
--- a/libavformat/file.c
+++ b/libavformat/file.c
@@ -233,6 +233,9 @@ static int64_t file_seek(URLContext *h, int64_t pos, int 
whence)
     FileContext *c = h->priv_data;
     int64_t ret;
 
+    if (c->follow && (whence == SEEK_END || whence == AVSEEK_SIZE))
+        return AVERROR(ENOSYS); /* true size is not known */
+
     if (whence == AVSEEK_SIZE) {
         struct stat st;
         ret = fstat(c->fd, &st);

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to