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 6956549B1F for ; Sun, 3 Mar 2024 14:55:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D942268D388; Sun, 3 Mar 2024 16:55:47 +0200 (EET) Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 35CF368D290 for ; Sun, 3 Mar 2024 16:55:41 +0200 (EET) Authentication-Results: mail0.khirnov.net; dkim=pass (2048-bit key; unprotected) header.d=khirnov.net header.i=@khirnov.net header.a=rsa-sha256 header.s=mail header.b=Gd+qcZ/r; dkim-atps=neutral Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id DB36B24048D for ; Sun, 3 Mar 2024 15:55:40 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id malmGwCUD-fj for ; Sun, 3 Mar 2024 15:55:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1709477740; bh=FwprxV5Vky1Mbp97yEWjrZ7bSDgkLnhok0/RJFWQuac=; h=Subject:From:To:In-Reply-To:References:Date:From; b=Gd+qcZ/r6zLezjFG4a47dA2Wxo8iOGsEAhTWa1FinfzD0S1n5M8ElYtZPvp4eyMCL xLPe7IyUg3WbvrTdgq0BBgMW+BWtMAaptNr7o1YyuCibqLae/LgG+bl05SncEhgGXV /ctj5TExoOjW/rgTcrYn0+AvTgWkvYZ/JpRkXj4Pc9bDmOxnIIYn5+RIgGaBka2fmo 0qt+JXhfzCQtqtNxrCIh3P+Nj5CarxQeRmLJWYWBXui07vWCrpqOYNC23Wp9iIYz++ HK07vnnt8XZtKxQD8SXAS9l0jhDwJ7lcvQD/R5PFAjYPt15RGsO6cNXlMG8jwGSkE1 tjqhTeAUBEmNg== Received: from lain.khirnov.net (lain.khirnov.net [IPv6:2001:67c:1138:4306::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "lain.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 0AFD2240177 for ; Sun, 3 Mar 2024 15:55:40 +0100 (CET) Received: by lain.khirnov.net (Postfix, from userid 1000) id DC4B11601B9; Sun, 3 Mar 2024 15:55:39 +0100 (CET) From: Anton Khirnov To: FFmpeg development discussions and patches In-Reply-To: <487a3c17-60c2-4466-d46d-180aea77910e@passwd.hu> References: <20240223143115.16521-1-anton@khirnov.net> <20240223143115.16521-16-anton@khirnov.net> <170896764704.29002.11257003666537600643@lain.khirnov.net> <487a3c17-60c2-4466-d46d-180aea77910e@passwd.hu> Mail-Followup-To: FFmpeg development discussions and patches Date: Sun, 03 Mar 2024 15:55:39 +0100 Message-ID: <170947773987.29002.5044553526345898034@lain.khirnov.net> User-Agent: alot/0.8.1 MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 15/38] lavu/opt: add array options 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: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: Quoting Marton Balint (2024-02-26 20:38:46) > The more I think about it, it is actually a broader problem. > > You are changing the semantics of existing AV_OPT_TYPE_xxx types. So > previously an option with AV_OPT_TYPE_STRING used to have default value in > default_val.str. After your patch, it will be either default_val.str, or > default_val.str[1], based on if it is an array or not. > > I think the API user safely assumed that if the option type is known to > him, he will always find the default value in the relevant default_val > field. It is actually a bigger issue for an array of AV_OPT_TYPE_INT, > because previously to get the default value AVOption->default_val.i64 was > used, and now .str[1] should be instead... In my view the semantics of default_val (and offset) are only defined when declaring options on your own object, not when accessing those fields when declared by some other code. I also see no good reason for any user to read these fields. -- Anton Khirnov _______________________________________________ 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".