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

Git pushed a commit to branch master
in repository ffmpeg.

commit f87323a35994ffb833945c6e67029c74629ed704
Author:     Niklas Haas <[email protected]>
AuthorDate: Sun Jun 14 13:03:34 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Tue Jun 23 20:33:00 2026 +0200

    avformat/http: properly fall back on soft seek failure
    
    If the HTTP server still has stale bytes in the TCP receive buffer, but
    the underlying conection was already closed, then the http_open_cnx()
    call might fail even though we successfully drained the previous request.
    
    In this case, there is no proper fallback to a new connection, leading to
    sudden truncation.
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 libavformat/http.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/libavformat/http.c b/libavformat/http.c
index ce98c01ae4..3d0656d046 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -2163,6 +2163,15 @@ static int64_t http_seek_internal(URLContext *h, int64_t 
off, int whence, int fo
             }
             remaining -= ret;
         }
+
+        ret = http_open_cnx(h, &options);
+        if (ret >= 0) {
+            goto done;
+        } else {
+            /* fall back to normal reconnection */
+            ffurl_closep(&s->hd);
+            old_hd = NULL;
+        }
     } else {
         /* can't soft seek; always open new connection */
         old_hd = s->hd;
@@ -2181,6 +2190,8 @@ static int64_t http_seek_internal(URLContext *h, int64_t 
off, int whence, int fo
         av_dict_free(&options);
         return ret;
     }
+
+done:
     av_dict_free(&options);
     ffurl_close(old_hd);
     return off;

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

Reply via email to