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 29B364A9BA for ; Wed, 5 Jun 2024 23:17:59 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE71F68D5F9; Thu, 6 Jun 2024 02:17:56 +0300 (EEST) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 702C568CED8 for ; Thu, 6 Jun 2024 02:17:50 +0300 (EEST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 9A46220002 for ; Wed, 5 Jun 2024 23:17:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=niedermayer.cc; s=gm1; t=1717629469; 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=60kIhb2WdD06E+U8L8l+XaRcXlAvwn0UaYmesG++Ws4=; b=OihA4szpcZP/5Qv5qLuJhP61Lyh/lbc+gE3fUBROt8go2v8NIaiJzSEYumGR57VUeiAVYH e4BLXWXyBuN8NG8gXopdXay9zPRSmGX0oxAu2Lo/Z07z2sUaTwuSrX633+txaULGddL0Wh Q/qhEu1+lISEMK5YDeWRlL0UzfRG4/FLLNtBMfCTVEAtQQ4KkZN9RN9RgO+4AhVTOPN+uq Jye0julo2kcw5c57wywqbKpEGEtWGoH/HxWrmYFm/NZCtZPSLHbaW8jCDTFsqVgguviARw f83V9NswduRm2xGKA+ea0w0Jlk/7ZNYhwTevgbSbb4WRQAHqcwCEsL/gvy1Pfw== Date: Thu, 6 Jun 2024 01:17:48 +0200 From: Michael Niedermayer To: FFmpeg development discussions and patches Message-ID: <20240605231748.GM2821752@pb2> References: <20240605131808.282394-1-ffmpeg-devel@pileofstuff.org> MIME-Version: 1.0 In-Reply-To: X-GND-Sasl: michael@niedermayer.cc Subject: Re: [FFmpeg-devel] [PATCH] lavu/opt: Mention that AVOptions is not reentrant 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="===============2087596473980038853==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============2087596473980038853== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="02TgiDMAH4DLwn5E" Content-Disposition: inline --02TgiDMAH4DLwn5E Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 05, 2024 at 03:22:55PM +0100, Andrew Sayers wrote: > On Wed, Jun 05, 2024 at 09:46:16AM -0400, Ronald S. Bultje wrote: > > Hi, > >=20 > > On Wed, Jun 5, 2024 at 9:44=E2=80=AFAM Andrew Sayers > > wrote: > >=20 > > > On Wed, Jun 05, 2024 at 03:34:50PM +0200, Paul B Mahol wrote: > > > > On Wed, Jun 5, 2024 at 3:18=E2=80=AFPM Andrew Sayers < > > > ffmpeg-devel@pileofstuff.org> > > > > wrote: > > > > > > > > > An external API developer might think they can use AVOptions to m= odify > > > > > values > > > > > during playback (e.g. putting a playback quality slider next to t= he > > > volume > > > > > slider). Make it clear that behaviour is not recommended. > > > > > > > > > > > > > There are options that can be changed at runtime, > > > > And it works just fine. > > > > > > How would an external developer know which options can be safely chan= ged > > > (preferably including in future versions of FFmpeg) vs. ones where th= eir > > > tests > > > got lucky and happened not to trigger a read during a non-atomic writ= e? > > > > >=20 > > If you see that happening, it would be good to submit a bug report. Rig= ht > > now it's very abstract. >=20 > I think we might be talking past each other - here's a concrete example: >=20 > The private struct "SetTSContext" includes an AVOptions-accessible member > "time_base", currently implemented as an AVRational (i.e. a pair of ints). > write_number() in libavutil/opt.c sets options of type AV_OPT_TYPE_RATION= AL > in such a way that a poorly-timed read could see the new numerator > and old denominator (or the other way around). >=20 > If I wrote a program that let users dynamically change the time base, > and someone switched their timebase from 1/30 to 100/3000, one unlucky us= er > might have a few frames encoded with a timebase of 100/30. Is that somet= hing > the AVOptions API is supposed to support? If yes, the bug is that > AVOptions access isn't guarded by a mutex. If no, there's no bug, just an > edge case worth mentioning in the docs. AVOption simply provides light weight access to the struct fields. Calling AVOption non re-entrant in modifying a field you arent even allowed to modify from 2 threads is confusing If you want to modify a field from 2 threads that field could be some sort of atomic type. This can then easily be added to AVOption thx [...] --=20 Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB "Nothing to hide" only works if the folks in power share the values of you and everyone you know entirely and always will -- Tom Scott --02TgiDMAH4DLwn5E Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABEKAB0WIQSf8hKLFH72cwut8TNhHseHBAsPqwUCZmDyGAAKCRBhHseHBAsP q1HcAJ44gNjO0yXW7WZNU+n8+F6XVGmBiACgjxL9hUJvQ3Tgp/k17JXgDzKeVd4= =rI71 -----END PGP SIGNATURE----- --02TgiDMAH4DLwn5E-- --===============2087596473980038853== 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". --===============2087596473980038853==--