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 68F794FE9C for ; Thu, 3 Jul 2025 15:52:17 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 75E3868ED06; Thu, 3 Jul 2025 18:52:13 +0300 (EEST) Received: from relay5-d.mail.gandi.net (relay5-d.mail.gandi.net [217.70.183.197]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 2F58168E4E3 for ; Thu, 3 Jul 2025 18:52:07 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 90B4E4433D for ; Thu, 3 Jul 2025 15:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1751557926; 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=EelI99pyaQguq8/cECv/GUUwWq4klUPoYS2snB+YeGE=; b=ba+Cpug/u6DHMIS9Ju9thoiTj+QTra55PoD6h/stPgzfSJ4bTjQSEtFAasjh2qJMBpJC8n OejwcS4P9v3nTK+DNKke1pWXBXPf61rAOwDvx5GFTynZpDLmXfrezwBPpbfIrGZmPpi1Jh 1cs8AmcLMpROGTGFAgyvRD3Bo1++uJsiAPQjUnkNZsyiomfBJ+8BcVfnKajffpzyZVT057 s3m4Xrq4pdnolLLHA1bKQ9KWEU9xRk8uXimUzRIoI7vpQc1XjDWri/feaBnix9FS4sHBZF DMcKJ8znyJ7gYptd0q55MiPxGsLWOq6JqZEPRPg96rSpwf6PWLbBvJJ9Q0VcVg== Date: Thu, 3 Jul 2025 17:52:05 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20250703155205.GK29660@pb2> References: <20250702144355.GE29660@pb2> <20250702171641.GF29660@pb2> MIME-Version: 1.0 In-Reply-To: X-GND-State: clean X-GND-Score: -70 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdefgddvtdeikecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtreertddtvdenucfhrhhomhepofhitghhrggvlhcupfhivgguvghrmhgrhigvrhcuoehmihgthhgrvghlsehnihgvuggvrhhmrgihvghrrdgttgeqnecuggftrfgrthhtvghrnhepieegkedtjeduffejhfetgeejtdegteetgfegtdfhjefgvefhteegkeejtddvhfevnecukfhppeeguddrieeirdeiiedrvddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeeguddrieeirdeiiedrvddvjedphhgvlhhopehlohgtrghlhhhoshhtpdhmrghilhhfrhhomhepmhhitghhrggvlhesnhhivgguvghrmhgrhigvrhdrtggtpdhnsggprhgtphhtthhopedupdhrtghpthhtohepfhhfmhhpvghgqdguvghvvghlsehffhhmphgvghdrohhrgh X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [RFC] Advanced 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="===============9212399962680263627==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============9212399962680263627== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="gVSaiyVKI8GfOR39" Content-Disposition: inline --gVSaiyVKI8GfOR39 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi On Thu, Jul 03, 2025 at 10:56:39AM +0200, Nicolas George wrote: > Michael Niedermayer (HE12025-07-02): [...] > To be clear, you suggest, IIUC: >=20 > - The developer registers the error code. > - The developer writes the explanation for the error when registering > the error code. > - The developer uses the error code when returning the error. > - The user gets an error code. > - The user looks up the error code to get the explanation for the error. no, just: return av_adv_err_new(AVERROR_INVALIDDATA, "Garbled foobar data", "Foo tria= ngle quantum decoder" __FILE__, __LINE__, NULL, "Whaetver you like %s", fav= orite_food); teh return type is int64_t here this also cannot fail as it allocates nothing it also needs no context but would use a mutex or thread local storage the message length would be bound by a maximum, set at compile time and the number of messages that this keeps track of also would be bound by a maximum, set at compile time >=20 > What I propose: >=20 > - The developer writes the explanation for the error when returning the > error. > - The user gets the explanation for the error directly. >=20 > Or, in terms of code: >=20 > return AVERROR_MESSAGE(ctx, "Garbled foobar data at offset ${offset}", > "offset", ctx->offset, NULL); I am not sure if passing a context around is going to find the volunteers to implement and maintain. Also it has a performance impact for small and lightweight functions. thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB For a strong democracy, genuine criticism is necessary, allegations benefit noone, they just cause unnecessary conflicts. - Narendra Modi --gVSaiyVKI8GfOR39 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCaGanIgAKCRBhHseHBAsP q4BJAJ0SGUnv8cDJN+Mw61gsjZQOPb3ArACfbVnNgihhu7YKAZuJGVMx3viY048= =ANxb -----END PGP SIGNATURE----- --gVSaiyVKI8GfOR39-- --===============9212399962680263627== 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". --===============9212399962680263627==--