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 DC6414DCA0 for ; Fri, 4 Jul 2025 14:52:38 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 6B06E68FABD; Fri, 4 Jul 2025 17:52:35 +0300 (EEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 215BD68FA9F for ; Fri, 4 Jul 2025 17:52:29 +0300 (EEST) Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-4538a2fc7ffso15087745e9.0 for ; Fri, 04 Jul 2025 07:52:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751640748; x=1752245548; darn=ffmpeg.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=DfYs49LgdFc4wBe/zX9ega28FDI7jKkJas+iOWeOfvQ=; b=WSTdisenvC3/X6IeCl+MS+/F4U/LxDo0MXXfC3kKQ1FUsqXUBPeCcP7UKzjnDUblcu z5oIe/KGPgQgcidVBJGTMkFYvOtck5jN3kQIQGRgIBpz67abLtpBAxRV86yebsoztoxg YCKoHFltXi03YmOlerwisjT1jYFXQ4kAj0wRUcJY31zhnq2CpMbWdb1cL3TYfVwo7mZx c0oAha1w31Hq0ejnlmn8V2XmcrHKyi4Csqnb5QUTN6S+VAztULrxfMpYjIjlBV5AGvLo ZWsdnp76i0L021+TmpFAmLuNUIjq0ecG09guvhNyu+PHr/dJDSf1YvqSR2fDEpz0QhN0 koBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751640748; x=1752245548; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DfYs49LgdFc4wBe/zX9ega28FDI7jKkJas+iOWeOfvQ=; b=KCl2j72RNISyhOr5gevAim+wZCGb1Is2HDqcYNl2s0VMLaH94BjAMDuToaNEJKQGRl Upug0YZBBGA62miYmVq+B2hz/KP7EaQf3OJGCkR8jeaBWp2OHOpLRVl6KWwNgHXtrbEk XI1cRB9IxZF3wRIuuTNdUZ7rHJvoaT9w9IMdPn5HZyPCOsrs3OR7aNbpwEf/H7OaeNQH UC8mOWOk9K2xeFWzPVf35ts9uhFK3I4GgT7buJajB73OPQ7DxfQ7FXTDvwwKSVnayCHN MhZIRj80WziIQpxgTizJbSRWiHa1Imf2YNHd+6D/qHVWfWert/9HPY7O6nqlj6bTfvYx rmkA== X-Gm-Message-State: AOJu0YxEOutzSSqNU7t8xwkzgr/IubEXE5wBJhqerohxM+/ZZBZkBaGo puguZWQ3F4tQxJCBPBxSrXpg04jX3KycRIbQrbYRIX918d9VSUWZuNWxepgTPw== X-Gm-Gg: ASbGncv1QITV7Q/o5ZZganwQEIrq8PdXtyJwrFjUAHB/eB3Pyf0QYhfik2Ba7myooG+ jK6U2BesX/UZ10Qo2PfRcKBXF8uugRjzpbKBvVYTBuWTnDRDEUMBTvG71VmWvLHIN96ekWMKFEn TD2BjJGF4u2p+aTIG/60i6f87fnwFY7jehsv2WmzC7qBNiltjG9c+9Xp2XWh4hWiVOIQ5DQdpL6 3TykjTaoPBmfmS2npFWSgdUxM2GzsG2itcZEJ7z/9gAtL9hURH33l+I95qo0lRQ1088XowkaZ/6 coI2MK5aNBhXqn/kcIMLCXbEDyV2QZszHMaRYv7AOX/mS7lDfIxV1C7ZWVP/otJYrOP18P/Lt8D OENYL3ieL7xdcMlr8xBdG/b1iJcKBZfSM8EuvCEYrRcIx7i7ck0YPyfKeiDKD/UJ1w7Fee4ChCX mz X-Google-Smtp-Source: AGHT+IGw1DjMHvzz27gWeNqiM3TApP+6CCz0R3N/cbnnFTltEybSkithkJkU/upXXUK+Cp8wgdPk7A== X-Received: by 2002:a05:6000:21c3:b0:3a6:d93e:526d with SMTP id ffacd0b85a97d-3b49310cdafmr1922285f8f.10.1751640748081; Fri, 04 Jul 2025 07:52:28 -0700 (PDT) Received: from [192.168.178.137] (p200301023701fa007c711eeeaa4bf578.dip0.t-ipconnect.de. [2003:102:3701:fa00:7c71:1eee:aa4b:f578]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3b47285d3c6sm2675485f8f.95.2025.07.04.07.52.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jul 2025 07:52:27 -0700 (PDT) From: Marvin Scholz To: FFmpeg development discussions and patches Date: Fri, 04 Jul 2025 16:52:26 +0200 X-Mailer: MailMate (2.0r6222) Message-ID: In-Reply-To: References: <20250624220805.50371-1-epirat07@gmail.com> <1B2B29DA-C587-4A6B-BCAB-DAFDA9DD6230@gmail.com> MIME-Version: 1.0 Subject: Re: [FFmpeg-devel] [PATCH 1/2] avformat/tee: refactor option processing 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: On 3 Jul 2025, at 11:08, Nicolas George wrote: > Marvin Scholz (HE12025-06-25): >> Would you be fine with just the removal of the messing with >> the AVDictionary entries then, leaving the macros in place, >> essentially removing STEAL_OPTION and doing a copy in CONSUME_OPTION? >> >> IMHO saving two copies of a string does not justify abusing the >> AVDictionary API in such a way. This isnt a hot code path either >> where this would make sense... > > It is not just a matter of saving a few cycles. What you propose > requires writing more code, including error checks and an occasion for > failure. If copying two strings fails here, it is highly unlikely any of the following code, needing much more memory, would have any chance of succeeding. > > If it was new code, I would consider it, but changing existing code that > has been working for years to make it more verbose, more failure prone Yes it introducers two copies which could fail but the chance for that happening is so small that I dont think it justifies using hacks like this, which also introduce risk of turning into more serious issues when the AVDictionary code is changed and someone is unaware of this hack here. > and less efficient, no, thanks. We are talking about copying two option strings here, during setup, not per frame, not every few seconds. > > Let us just document that it is a valid use. > I disagree making this hack official. It will make any further changes to AVDictionary even harder if we have to consider the user messing with it in such ways. Let's not sacrifice code quality and proper APIs for the sake of 'efficiency'. The main reason I want to get rid of this is so that av_dict_get's return value can be made const which is only blocked by this one use here. Nowhere else in ffmpegs code do we do this, I really see no sufficient justification to do it here. Regards, Marvin Scholz > Regards, > > -- > Nicolas George > _______________________________________________ > 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". _______________________________________________ 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".