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

Git pushed a commit to branch master
in repository ffmpeg.

commit be6b6743b81109b865964325b1ffce88c92888fb
Author:     Kacper Michajłow <[email protected]>
AuthorDate: Sun Jul 26 13:48:09 2026 +0200
Commit:     Kacper Michajłow <[email protected]>
CommitDate: Mon Jul 27 17:05:20 2026 +0000

    avformat/libcurl: improve content size tracking
    
    Track the size for non-seekable replies too, don't reset a known size when
    a reply omits it, and don't store the encoded length of a compressed body.
    
    Signed-off-by: Kacper Michajłow <[email protected]>
---
 libavformat/libcurl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavformat/libcurl.c b/libavformat/libcurl.c
index 735370cc76..c7d786cba4 100644
--- a/libavformat/libcurl.c
+++ b/libavformat/libcurl.c
@@ -336,7 +336,7 @@ static size_t header_callback(char *ptr, size_t size, 
size_t nitems, void *userd
          * gives us free compression for other payloads like text playlist. */
         c->seekable = !c->hdr_compressed &&
                       (status == 206 || c->hdr_accept_ranges);
-        if (c->seekable) {
+        if (!c->hdr_compressed) {
             int64_t total = c->hdr_content_total;
             if (total < 0 && status != 206) {
                 curl_off_t cl = -1;
@@ -344,8 +344,11 @@ static size_t header_callback(char *ptr, size_t size, 
size_t nitems, void *userd
                                       &cl) == CURLE_OK && cl >= 0)
                     total = cl;
             }
-            c->content_size = total;
-
+            /* Don't unlearn a known size when a reply omits it. */
+            if (total >= 0)
+                c->content_size = total;
+        }
+        if (c->seekable) {
             if (c->hdr_content_end >= 0)
                 c->request_end = c->hdr_content_end;
             else

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

Reply via email to