From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 18AF64C247 for ; Thu, 9 Oct 2025 06:55:41 +0000 (UTC) Authentication-Results: ffbox; dkim=fail (body hash mismatch (got b'i6ZWlEEwZXuc/sEajiBDfJQGZiyrPL94lAHltk4Ou/Q=', expected b'oXgHvZKA8XukSuhL7jS42sF627P89GCq1R14mizXyfk=')) header.d=ffmpeg.org header.i=@ffmpeg.org header.a=rsa-sha256 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759992930; h=mime-version : to : date : message-id : reply-to : subject : list-id : list-archive : list-archive : list-help : list-owner : list-post : list-subscribe : list-unsubscribe : from : cc : content-type : content-transfer-encoding : from; bh=i6ZWlEEwZXuc/sEajiBDfJQGZiyrPL94lAHltk4Ou/Q=; b=4B7sJvI5pNi9p0ljK1XV0QbIGE44WT4xYetP6fmnyfqeIw+6PyqerzJ+l1tbq68P2nlhT mbuWLK2DEgSlPERN2rHBgCZnGy3eYe92O9x2/L4MZ6jVo79gN/pfLYZv00tbzTjTD6azufi hoMRSD1j3EHFhYaDatYV1A1+XKSw0Vqp+VPkrH9cOfoDDKTDM+H9J5W2c5SayiTL7IlOw3g wBfVGe8BiJVR2QfS2zrKZ1XaRUGodI+rMJ67tS7i5OkZikPKtQkO0xS1ieEBrdlPXJBDyTL mZ9Foj1at8M7+5DjcCR6mMsV6GZis7lN18ejl0aB7sXsv70A63wKUHAvS3iw== Received: from [172.18.0.2] (unknown [172.19.0.4]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 76FB268F1B9; Thu, 9 Oct 2025 09:55:30 +0300 (EEST) ARC-Seal: i=1; cv=none; a=rsa-sha256; d=ffmpeg.org; s=arc; t=1759992907; b=HSJv9EYi3+l8NC162KVJton7pjkxRaddyMMcvKs53F+NfYvpldjY3JLTBdEw2m6fIZmj5 600F0576xrJAWvBdfl6TMAz9YZzc9e7E4AZBm/Tfa0jUCGXZJyqusVuJwybA/l3nhSRrY2p 81s/p0BFidmTnpoFK1/zXWNOQtjM3mwzN1ChVtefI1D28WULTuVaTOhIsC9FkICPvDnKEiR 4NGHNzjdsPo8y6GdrfBIS+xHB5AAHwpfoSndPhF4+P1QGhkTiAsHRKZIxr/cl1LQppo8tJt GSuGrLVKzVRDOX1gvqGcPf1Sziy29iLqadgvZU7KjnRtcjFasn3fH6i2Hn7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=ffmpeg.org; s=arc; t=1759992907; h=from : sender : reply-to : subject : date : message-id : to : cc : mime-version : content-type : content-transfer-encoding : content-id : content-description : resent-date : resent-from : resent-sender : resent-to : resent-cc : resent-message-id : in-reply-to : references : list-id : list-help : list-unsubscribe : list-subscribe : list-post : list-owner : list-archive; bh=VO9FIlLZTsBmwUjSqAXH55KeQJC0FX+G1uBePemm4tY=; b=dLROyxLJHJTOwEY4EbyXeWZJ2ERL1ZUWY040+Nw7i0hdU68tg4fjzibktG6kd+YxhJBQ0 xqUP6sTpSpf72DF0q0OC3mpSBDiGMiX0WXEyHPM0unb3TFpitiEssx2Oikl2VqewkusciOh /EY3i4X9/z+8NyVuWr5nuTQl2A4yiGHPIDS4E/2XKuavSPvL76O4pCym6aIZ4rHa3IjwlIy 0adNtXq3sqiDWiqSvH1hVhqt3wLoj5JBDfTFkL/zb27thICuJwzRfJsy5Oowv4SHWkgaKSa JsVYcVk5D/jUy6bbgz/68t90dTtBBzsTzG81OsZcWDF/gdG0wQgvu0RoVOkA== ARC-Authentication-Results: i=1; ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none; dmarc=pass header.from=ffmpeg.org policy.dmarc=quarantine Authentication-Results: ffmpeg.org; dkim=pass header.d=ffmpeg.org header.i=@ffmpeg.org; arc=none (Message is not ARC signed); dmarc=pass (Used From Domain Record) header.from=ffmpeg.org policy.dmarc=quarantine DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ffmpeg.org; i=@ffmpeg.org; q=dns/txt; s=mail; t=1759992900; h=content-type : mime-version : content-transfer-encoding : from : to : reply-to : subject : date : from; bh=oXgHvZKA8XukSuhL7jS42sF627P89GCq1R14mizXyfk=; b=t8LG/Ehks87hDUjJwRozkOXZ3stksjvep/wx6uShAIETq6PCOqzhBn8W7Qd4pYdIFkcIt xqDN2AwIHVSH5OFkCTW5A+fhL6PEEUMeGAT7qKP/k/kF2ZZLPySlZEijNsWyqGS50HmrvQ3 FgBuJc8cTKpT1eWUhijsVJKHPSnRRzooUSXWiaE5dnFOhQuaSF3QdzUFiWwcoGpNJlamG9Q IcbH4mqq23y4uGJqnayJVk2QgsKgQSDpCSXgn4DwNPciDY/a//nt7/M5ZjPmpDVmP8RRZlP JOGVnXepidSpW5PXM9Mb3zru33DfCU3y4r19FSNUMPJmgqf+Yy+gXsqA6WsQ== Received: from be50bb5a3685 (code.ffmpeg.org [188.245.149.3]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id DB9A768F01F for ; Thu, 9 Oct 2025 09:55:00 +0300 (EEST) MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Date: Thu, 09 Oct 2025 06:55:00 -0000 Message-ID: <175999290100.65.8682990166039430515@bf249f23a2c8> Message-ID-Hash: 2TU3WGAZRSAGUIKMR2VG4HEO4MJDQ32R X-Message-ID-Hash: 2TU3WGAZRSAGUIKMR2VG4HEO4MJDQ32R X-MailFrom: code@ffmpeg.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; header-match-ffmpeg-devel.ffmpeg.org-0; header-match-ffmpeg-devel.ffmpeg.org-1; header-match-ffmpeg-devel.ffmpeg.org-2; header-match-ffmpeg-devel.ffmpeg.org-3; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list Reply-To: FFmpeg development discussions and patches Subject: [FFmpeg-devel] [PATCH] improve error messages when strerror_r is not available (PR #20680) List-Id: FFmpeg development discussions and patches Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: timblechmann via ffmpeg-devel Cc: timblechmann Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Archived-At: List-Archive: List-Post: PR #20680 opened by timblechmann URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20680 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20680.patch * add more fallbacks with different error codes * add strerror_s codepath for windows/msvc >>From 6ea5baadd63ae9ab37855fb3ede56415ff671663 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 9 Oct 2025 14:44:21 +0800 Subject: [PATCH 1/2] avutil: add missing error codes av_strerror does not implement fallbacks for many posix error codes when strerror_r is not available. Adding the missing entries. --- libavutil/error.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) diff --git a/libavutil/error.c b/libavutil/error.c index 90bab7b9d3..e7867cad71 100644 --- a/libavutil/error.c +++ b/libavutil/error.c @@ -103,6 +103,129 @@ static const struct error_entry error_entries[] = { { EERROR_TAG(ESPIPE), "Illegal seek" }, { EERROR_TAG(ESRCH), "No such process" }, { EERROR_TAG(EXDEV), "Cross-device link" }, +#ifdef EADDRINUSE + { EERROR_TAG(EADDRINUSE), "Address in use" }, +#endif +#ifdef EADDRNOTAVAIL + { EERROR_TAG(EADDRNOTAVAIL), "Address not available" }, +#endif +#ifdef EAFNOSUPPORT + { EERROR_TAG(EAFNOSUPPORT), "Address family not supported" }, +#endif +#ifdef EALREADY + { EERROR_TAG(EALREADY), "Connection already in progress" }, +#endif +#ifdef EBADMSG + { EERROR_TAG(EBADMSG), "Bad message" }, +#endif +#ifdef ECANCELED + { EERROR_TAG(ECANCELED), "Operation canceled" }, +#endif +#ifdef ECONNABORTED + { EERROR_TAG(ECONNABORTED), "Connection aborted" }, +#endif +#ifdef ECONNREFUSED + { EERROR_TAG(ECONNREFUSED), "Connection refused" }, +#endif +#ifdef ECONNRESET + { EERROR_TAG(ECONNRESET), "Connection reset" }, +#endif +#ifdef EDESTADDRREQ + { EERROR_TAG(EDESTADDRREQ), "Destination address required" }, +#endif +#ifdef EHOSTUNREACH + { EERROR_TAG(EHOSTUNREACH), "Host unreachable" }, +#endif +#ifdef EIDRM + { EERROR_TAG(EIDRM), "Identifier removed" }, +#endif +#ifdef EINPROGRESS + { EERROR_TAG(EINPROGRESS), "Operation in progress" }, +#endif +#ifdef EISCONN + { EERROR_TAG(EISCONN), "Already connected" }, +#endif +#ifdef ELOOP + { EERROR_TAG(ELOOP), "Too many symbolic link levels" }, +#endif +#ifdef EMSGSIZE + { EERROR_TAG(EMSGSIZE), "Message size" }, +#endif +#ifdef ENETDOWN + { EERROR_TAG(ENETDOWN), "Network down" }, +#endif +#ifdef ENETRESET + { EERROR_TAG(ENETRESET), "Network reset" }, +#endif +#ifdef ENETUNREACH + { EERROR_TAG(ENETUNREACH), "Network unreachable" }, +#endif +#ifdef ENOBUFS + { EERROR_TAG(ENOBUFS), "No buffer space" }, +#endif +#ifdef ENODATA + { EERROR_TAG(ENODATA), "No message available" }, +#endif +#ifdef ENOLINK + { EERROR_TAG(ENOLINK), "No link" }, +#endif +#ifdef ENOMSG + { EERROR_TAG(ENOMSG), "No message" }, +#endif +#ifdef ENOPROTOOPT + { EERROR_TAG(ENOPROTOOPT), "No protocol option" }, +#endif +#ifdef ENOSR + { EERROR_TAG(ENOSR), "No stream resources" }, +#endif +#ifdef ENOSTR + { EERROR_TAG(ENOSTR), "Not a stream" }, +#endif +#ifdef ENOTCONN + { EERROR_TAG(ENOTCONN), "Not connected" }, +#endif +#ifdef ENOTRECOVERABLE + { EERROR_TAG(ENOTRECOVERABLE), "State not recoverable" }, +#endif +#ifdef ENOTSOCK + { EERROR_TAG(ENOTSOCK), "Not a socket" }, +#endif +#ifdef ENOTSUP + { EERROR_TAG(ENOTSUP), "Not supported" }, +#endif +#ifdef EOPNOTSUPP + { EERROR_TAG(EOPNOTSUPP), "Operation not supported" }, +#endif +#ifdef EOTHER + { EERROR_TAG(EOTHER), "Other" }, +#endif +#ifdef EOVERFLOW + { EERROR_TAG(EOVERFLOW), "Value too large" }, +#endif +#ifdef EOWNERDEAD + { EERROR_TAG(EOWNERDEAD), "Owner dead" }, +#endif +#ifdef EPROTO + { EERROR_TAG(EPROTO), "Protocol error" }, +#endif +#ifdef EPROTONOSUPPORT + { EERROR_TAG(EPROTONOSUPPORT), "Protocol not supported" }, +#endif +#ifdef EPROTOTYPE + { EERROR_TAG(EPROTOTYPE), "Wrong protocol type" }, +#endif +#ifdef ETIME + { EERROR_TAG(ETIME), "Stream timeout" }, +#endif +#ifdef ETIMEDOUT + { EERROR_TAG(ETIMEDOUT), "Timed out" }, +#endif +#ifdef ETXTBSY + { EERROR_TAG(ETXTBSY), "Text file busy" }, +#endif +#ifdef EWOULDBLOCK + { EERROR_TAG(EWOULDBLOCK), "Operation would block" }, +#endif #endif }; -- 2.49.1 >>From c09b672527fa32dd0950cfd998fe5aefaffb9550 Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Thu, 9 Oct 2025 14:53:22 +0800 Subject: [PATCH 2/2] avutil: av_strerror - add implementation via strerror_s win32 does not have strerror_r, but strerror_s. adding a codepath to av_strerror, that makes use of it. --- libavutil/error.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libavutil/error.c b/libavutil/error.c index e7867cad71..088dcf7483 100644 --- a/libavutil/error.c +++ b/libavutil/error.c @@ -25,6 +25,10 @@ #include "error.h" #include "macros.h" +#if defined(_WIN32) && defined(_MSC_VER) +#define HAVE_STRERROR_S +#endif + struct error_entry { int num; const char *tag; @@ -64,7 +68,7 @@ static const struct error_entry error_entries[] = { { ERROR_TAG(HTTP_TOO_MANY_REQUESTS), "Server returned 429 Too Many Requests" }, { ERROR_TAG(HTTP_OTHER_4XX), "Server returned 4XX Client Error, but not one of 40{0,1,3,4}" }, { ERROR_TAG(HTTP_SERVER_ERROR), "Server returned 5XX Server Error reply" }, -#if !HAVE_STRERROR_R +#if !HAVE_STRERROR_R && !defined(HAVE_STRERROR_S) { EERROR_TAG(E2BIG), "Argument list too long" }, { EERROR_TAG(EACCES), "Permission denied" }, { EERROR_TAG(EAGAIN), "Resource temporarily unavailable" }, @@ -226,7 +230,7 @@ static const struct error_entry error_entries[] = { #ifdef EWOULDBLOCK { EERROR_TAG(EWOULDBLOCK), "Operation would block" }, #endif -#endif +#endif // !HAVE_STRERROR_R && !defined(HAVE_STRERROR_S) }; int av_strerror(int errnum, char *errbuf, size_t errbuf_size) @@ -245,6 +249,8 @@ int av_strerror(int errnum, char *errbuf, size_t errbuf_size) } else { #if HAVE_STRERROR_R ret = AVERROR(strerror_r(AVUNERROR(errnum), errbuf, errbuf_size)); +#elif defined(HAVE_STRERROR_S) + ret = AVERROR(strerror_s(errbuf, errbuf_size, AVUNERROR(errnum))); #else ret = -1; #endif -- 2.49.1 _______________________________________________ ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org