From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4EC4049FDD for ; Wed, 17 Jul 2024 21:07:09 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 7BFF368D8A4; Thu, 18 Jul 2024 00:07:05 +0300 (EEST) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 742B468D855 for ; Thu, 18 Jul 2024 00:06:58 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id B3DE660006 for ; Wed, 17 Jul 2024 21:06:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1721250417; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MaD0p9ANYDnAcoppcGYoi86+auCt8AXBcG0m9e0MP0c=; b=nBYeATf/xGeYPwZJnJKHBDmyMIqfsEJZF0F57SnHarCqfx+ebE5oRElZ7H94/ahym/Wwh6 xc9NH8SnnLbj2BdJk8iEld4uoJDVPqu+8ASF1pgY++HszHmVbIdBxgJauRCvqEQb00H6Lq t96wrqlwelHURVdJw8cQuaQFmuLsuh8QpSd8B4PKC9DkCrspj3rWaTx9NPIzYUJxy3MyuH m60SRtHKuKb/2/hfYnZVF9EgRITH5S2qb6LUJwUT2VdjzXCt9GyOh3DnC2bVj0YFSO9zyP 7M3CFdGAJ5fFlf5U3EZZnSqRK4E8uMJfMfhhZ06WdKE1VNXIyYxAWTyfKOyPBw== Date: Wed, 17 Jul 2024 23:06:56 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240717210656.GU4991@pb2> References: <9e16396a-4ef2-fdb3-fce8-94e19a141473@passwd.hu> <20240716111543.2437488-1-ffmpeg-devel@pileofstuff.org> <20240716111543.2437488-2-ffmpeg-devel@pileofstuff.org> MIME-Version: 1.0 In-Reply-To: <20240716111543.2437488-2-ffmpeg-devel@pileofstuff.org> X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [RFC PATCH v2] avutil/error: Provide better feedback about unknown error codes X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Content-Type: multipart/mixed; boundary="===============5553291047772228154==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============5553291047772228154== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gcRizOIrS73O/qKd" Content-Disposition: inline --gcRizOIrS73O/qKd Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 16, 2024 at 12:13:10PM +0100, Andrew Sayers wrote: > AVERROR messages should always be less than zero, > and are usually based on three or four ASCII characters. >=20 > For error codes that aren't explicitly handled by error.c (e.g. FFERROR_R= EDO), > print the ASCII code so the user has a little more information. >=20 > If a non-negative number somehow gets passed to this function, > print a message saying this shouldn't happen. [...] > + } else if (errnum >=3D 0) { > + snprintf(errbuf, errbuf_size, "Impossible: non-negative error nu= mber %d occurred, please report this bug", errnum); > } else { > #if HAVE_STRERROR_R > ret =3D AVERROR(strerror_r(AVUNERROR(errnum), errbuf, errbuf_siz= e)); > @@ -126,7 +160,7 @@ int av_strerror(int errnum, char *errbuf, size_t errb= uf_size) > ret =3D -1; > #endif > if (ret < 0) > - snprintf(errbuf, errbuf_size, "Error number %d occurred", er= rnum); > + snprintf(errbuf, errbuf_size, "Error number -0x%X occurred, = please report this bug", -errnum); > } I think this (asking for a report and pointing out to the user that this isnt supposed to happen), is a good idea thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Many things microsoft did are stupid, but not doing something just because microsoft did it is even more stupid. If everything ms did were stupid they would be bankrupt already. --gcRizOIrS73O/qKd Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZpgybQAKCRBhHseHBAsP q/IyAKCNPLNJmV0hsbsfehj9ZV5J4HYwmQCdGpZI5W3UrA4QZp/ugluLQ3Chi8k= =9EDP -----END PGP SIGNATURE----- --gcRizOIrS73O/qKd-- --===============5553291047772228154== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============5553291047772228154==--