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 368D54B3F3 for ; Fri, 5 Jul 2024 19:50:28 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id BAFB068DBA1; Fri, 5 Jul 2024 22:50:26 +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 2823868DBA0 for ; Fri, 5 Jul 2024 22:50:21 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 8273760004 for ; Fri, 5 Jul 2024 19:50:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1720209020; 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=U9PSKVAwsKF5Yqt7h1Xxw6Pp9f1g9+WnnWbXMaj29w0=; b=l4oKIVGgWZJlyojCjZ8hmFrTGLirt5GM8UW8hMZ034CamcJJR2lgWIytKJeBWyYLrHhcfP vH1XFTkXKgu8DdK5osY0vWo0GC3sH4KThB3c/0KK530dVfEy3x5Iwcyl9dMl+so6UigscB s8EqFtJntlpJVkdVzvtHUTYJj/XlIzjZ9fVq6w24F1oX7381ii4rl7zr+CYdlZxb7iOpl8 fUONHlEFapKQemlKW1hH8pzpIPWSKfZIBNd1F9xZuOkvhO4jEzoWtxRgnuXiPShq9vD1pD zUVFDv+k6W/E/GhfzyBHkCds/8b0G+okf+JN6bQlXkdRR2h+M8r8D9PnLM0aFw== Date: Fri, 5 Jul 2024 21:50:19 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240705195019.GC4991@pb2> References: MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] Sorry state of AVOptions 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="===============1248662384716879310==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============1248662384716879310== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="aRuUY7KzmetiZjaI" Content-Disposition: inline --aRuUY7KzmetiZjaI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Jul 04, 2024 at 04:44:39PM +0200, Paul B Mahol wrote: > The AVOptions state is extremely ugly. >=20 > It is insane to request from library users to convert non-strings option > values from/to strings to be able to read/change them, it is ugly, > inefficient, and slow. This becomes more relevant for recent array options > extension for which av_opt_ptr() hack does not work at all. maybe reverting this, will make array somewhat work with av_opt_ptr() @@ -1794,7 +2016,9 @@ const AVClass *av_opt_child_class_iterate(const AVCla= ss *parent, void **iter) void *av_opt_ptr(const AVClass *class, void *obj, const char *name) { const AVOption *opt=3D av_opt_find2(&class, name, NULL, 0, AV_OPT_SEAR= CH_FAKE_OBJ, NULL); - if(!opt) + + // no direct access to array-type options + if (!opt || (opt->type & AV_OPT_TYPE_FLAG_ARRAY)) return NULL; return (uint8_t*)obj + opt->offset; } thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact --aRuUY7KzmetiZjaI Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZohOdwAKCRBhHseHBAsP qyO5AJ9IgH6sbj2EN4UYGAnYNvhKpp+EXACbBRCYoSzU8+iOyFxo/E/Tj/BEt7U= =WD3+ -----END PGP SIGNATURE----- --aRuUY7KzmetiZjaI-- --===============1248662384716879310== 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". --===============1248662384716879310==--