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

Git pushed a commit to branch master
in repository ffmpeg.

commit 71c01ff4f6b3433e551d3ff0ae2b8d2125eb56e2
Author:     Niklas Haas <[email protected]>
AuthorDate: Thu Jun 25 11:00:48 2026 +0200
Commit:     Niklas Haas <[email protected]>
CommitDate: Sun Jun 28 12:49:17 2026 +0200

    avformat/http: move ff_http_averror() to header
    
    This is used by rtsp.c (and the upcoming libcurl.c) as well. Moving it to a
    header prevents a link failure if http_protocol were to ever
    become disabled.
    
    Sponsored-by: nxtedition AB
    Signed-off-by: Niklas Haas <[email protected]>
---
 libavformat/http.c | 18 ------------------
 libavformat/http.h | 21 +++++++++++++++++++--
 2 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/libavformat/http.c b/libavformat/http.c
index 9deb96699f..e9941a414f 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -612,24 +612,6 @@ int ff_http_do_new_request2(URLContext *h, const char 
*uri, AVDictionary **opts)
     return ret;
 }
 
-int ff_http_averror(int status_code, int default_averror)
-{
-    switch (status_code) {
-        case 400: return AVERROR_HTTP_BAD_REQUEST;
-        case 401: return AVERROR_HTTP_UNAUTHORIZED;
-        case 403: return AVERROR_HTTP_FORBIDDEN;
-        case 404: return AVERROR_HTTP_NOT_FOUND;
-        case 429: return AVERROR_HTTP_TOO_MANY_REQUESTS;
-        default: break;
-    }
-    if (status_code >= 400 && status_code <= 499)
-        return AVERROR_HTTP_OTHER_4XX;
-    else if (status_code >= 500)
-        return AVERROR_HTTP_SERVER_ERROR;
-    else
-        return default_averror;
-}
-
 const char* ff_http_get_new_location(URLContext *h)
 {
     HTTPContext *s = h->priv_data;
diff --git a/libavformat/http.h b/libavformat/http.h
index d1b691826b..08605c8f91 100644
--- a/libavformat/http.h
+++ b/libavformat/http.h
@@ -22,6 +22,7 @@
 #ifndef AVFORMAT_HTTP_H
 #define AVFORMAT_HTTP_H
 
+#include "libavutil/error.h"
 #include "url.h"
 
 #define HTTP_HEADERS_SIZE 4096
@@ -60,8 +61,24 @@ int ff_http_do_new_request(URLContext *h, const char *uri);
  */
 int ff_http_do_new_request2(URLContext *h, const char *uri, AVDictionary 
**options);
 
-int ff_http_averror(int status_code, int default_averror);
-
 const char* ff_http_get_new_location(URLContext *h);
 
+static inline int ff_http_averror(int status_code, int default_averror)
+{
+    switch (status_code) {
+        case 400: return AVERROR_HTTP_BAD_REQUEST;
+        case 401: return AVERROR_HTTP_UNAUTHORIZED;
+        case 403: return AVERROR_HTTP_FORBIDDEN;
+        case 404: return AVERROR_HTTP_NOT_FOUND;
+        case 429: return AVERROR_HTTP_TOO_MANY_REQUESTS;
+        default: break;
+    }
+    if (status_code >= 400 && status_code <= 499)
+        return AVERROR_HTTP_OTHER_4XX;
+    else if (status_code >= 500)
+        return AVERROR_HTTP_SERVER_ERROR;
+    else
+        return default_averror;
+}
+
 #endif /* AVFORMAT_HTTP_H */

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

Reply via email to