aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorDerek Buitenhuis <derek.buitenhuis@gmail.com>2024-04-22 15:25:40 +0100
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2024-04-25 14:14:36 +0100
commitb79260550b3da6336eae00f0a81af45c70d8f000 (patch)
tree9e07642296109a90a67b2c650ea5eca79d6e3d03 /libavformat
parentbcae59b8982f0836bfa1f86b320a199f20ca9afc (diff)
downloadffmpeg-b79260550b3da6336eae00f0a81af45c70d8f000.tar.gz
avformat/http: Use AVERROR_HTTP_TOO_MANY_REQUESTS
Added in the previous commit. Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/http.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libavformat/http.c b/libavformat/http.c
index ed20359552..82f46bb059 100644
--- a/libavformat/http.c
+++ b/libavformat/http.c
@@ -286,6 +286,7 @@ static int http_should_reconnect(HTTPContext *s, int err)
case AVERROR_HTTP_UNAUTHORIZED:
case AVERROR_HTTP_FORBIDDEN:
case AVERROR_HTTP_NOT_FOUND:
+ case AVERROR_HTTP_TOO_MANY_REQUESTS:
case AVERROR_HTTP_OTHER_4XX:
status_group = "4xx";
break;
@@ -522,6 +523,7 @@ int ff_http_averror(int status_code, int default_averror)
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)
@@ -558,6 +560,11 @@ static int http_write_reply(URLContext* h, int status_code)
reply_code = 404;
reply_text = "Not Found";
break;
+ case AVERROR_HTTP_TOO_MANY_REQUESTS:
+ case 429:
+ reply_code = 429;
+ reply_text = "Too Many Requests";
+ break;
case 200:
reply_code = 200;
reply_text = "OK";