PR #22688 opened by pszemus
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22688
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22688.patch

This commit fixes logging levels in error messages and makes `http` format 
logging less verbose.

"Opening" messages can flood the log while processing a live HTTP stream (e.g. 
HLS) and they should be treated as verbose/debug logs.

Signed-off-by: pszemus <[email protected]>


>From 58001f1b2125a31c3a1145521b239f9290692676 Mon Sep 17 00:00:00 2001
From: pszemus <[email protected]>
Date: Thu, 2 Apr 2026 13:58:40 +0000
Subject: [PATCH] avformat/http: Fix logging levels

This commit fixes logging levels in error messages and makes `http` logging 
less verbose.

"Opening" messages can flood the log while processing a live HTTP stream (e.g. 
HLS) and they should be treated as verbose/debug logs.

Signed-off-by: pszemus <[email protected]>
---
 libavformat/http.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 32ec5192c4..a4ab1adcbc 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -544,12 +544,12 @@ int ff_http_do_new_request2(URLContext *h, const char 
*uri, AVDictionary **opts)
                  hostname2, sizeof(hostname2), &port2,
                  NULL, 0, uri);
     if (strcmp(proto1, proto2) != 0) {
-        av_log(h, AV_LOG_INFO, "Cannot reuse HTTP connection for different 
protocol %s vs %s\n",
+        av_log(h, AV_LOG_ERROR, "Cannot reuse HTTP connection for different 
protocol %s vs %s\n",
                proto1, proto2);
         return AVERROR(EINVAL);
     }
     if (port1 != port2 || strncmp(hostname1, hostname2, sizeof(hostname2)) != 
0) {
-        av_log(h, AV_LOG_INFO, "Cannot reuse HTTP connection for different 
host: %s:%d != %s:%d\n",
+        av_log(h, AV_LOG_ERROR, "Cannot reuse HTTP connection for different 
host: %s:%d != %s:%d\n",
             hostname1, port1,
             hostname2, port2
         );
@@ -583,7 +583,7 @@ int ff_http_do_new_request2(URLContext *h, const char *uri, 
AVDictionary **opts)
     if ((ret = av_opt_set_dict(s, opts)) < 0)
         return ret;
 
-    av_log(s, AV_LOG_INFO, "Opening \'%s\' for %s\n", uri, h->flags & 
AVIO_FLAG_WRITE ? "writing" : "reading");
+    av_log(s, AV_LOG_VERBOSE, "Opening \'%s\' for %s\n", uri, h->flags & 
AVIO_FLAG_WRITE ? "writing" : "reading");
     ret = http_open_cnx(h, &options);
     av_dict_free(&options);
     return ret;
-- 
2.52.0

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

Reply via email to