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

Git pushed a commit to branch release/5.1
in repository ffmpeg.

commit 9f9d9d2de0f87fbfe9d0e771eaf9c5aa9c6d8360
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Jan 14 03:21:46 2026 +0100
Commit:     Michael Niedermayer <[email protected]>
CommitDate: Tue May 5 15:21:04 2026 +0200

    avformat/http: allow adjusting the redirect limit
    
    Idea from: BapToutatis and also curl and wget have equivalent options
    
    Signed-off-by: Michael Niedermayer <[email protected]>
    (cherry picked from commit ba3639bc908624dd9d2166f7d933f8ea6eeb877b)
    Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/http.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index d9931cae36..6c3601600b 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -136,6 +136,7 @@ typedef struct HTTPContext {
     char *new_location;
     AVDictionary *redirect_cache;
     uint64_t filesize_from_content_range;
+    int max_redirects;
 } HTTPContext;
 
 #define OFFSET(x) offsetof(HTTPContext, x)
@@ -178,6 +179,7 @@ static const AVOption options[] = {
     { "resource", "The resource requested by a client", OFFSET(resource), 
AV_OPT_TYPE_STRING, { .str = NULL }, 0, 0, E },
     { "reply_code", "The http status code to return to a client", 
OFFSET(reply_code), AV_OPT_TYPE_INT, { .i64 = 200}, INT_MIN, 599, E},
     { "short_seek_size", "Threshold to favor readahead over seek.", 
OFFSET(short_seek_size), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, D },
+    { "max_redirects", "Maximum number of redirects", OFFSET(max_redirects), 
AV_OPT_TYPE_INT, { .i64 = MAX_REDIRECTS }, 0, INT_MAX, D },
     { NULL }
 };
 
@@ -422,7 +424,7 @@ redo:
         s->new_location) {
         /* url moved, get next */
         ffurl_closep(&s->hd);
-        if (redirects++ >= MAX_REDIRECTS)
+        if (redirects++ >= s->max_redirects)
             return AVERROR(EIO);
 
         if (!s->expires) {

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

Reply via email to