From patchwork Sun Mar 31 05:31:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Rheinhardt X-Patchwork-Id: 47678 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:9f96:b0:1a3:b6bb:3029 with SMTP id mm22csp94341pzb; Sat, 30 Mar 2024 22:31:49 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV3iqZ9+VPnTxAi8kjzH8qPr8nlz4mRTeKrYrpMdISnpN3Pu4aCcN+Doi82hD946wC7ytooct7RuxCMN3SzbA6WzFrgXDhaeF8nlQ== X-Google-Smtp-Source: AGHT+IETa2L+vhOX4jGPQvXgJJpxU6gTOrWaIiaLhwNMZxa2I8ObXARlZguf3YrC96HkbZy4YFDV X-Received: by 2002:ac2:4349:0:b0:513:7e83:b3f2 with SMTP id o9-20020ac24349000000b005137e83b3f2mr4896643lfl.45.1711863108923; Sat, 30 Mar 2024 22:31:48 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id pw12-20020a17090720ac00b00a4e56729100si815373ejb.1043.2024.03.30.22.31.48; Sat, 30 Mar 2024 22:31:48 -0700 (PDT) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@outlook.com header.s=selector1 header.b=oION9l26; arc=fail (body hash mismatch); spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=outlook.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 9B69568CC35; Sun, 31 Mar 2024 08:31:44 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03olkn2013.outbound.protection.outlook.com [40.92.57.13]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 5453468C30E for ; Sun, 31 Mar 2024 08:31:37 +0300 (EEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h5grWkaREdIhEXmGg4NIRtCBeDUc98/kEetqtJPaZaA7KAa035srKFDveOi/IRbPrjadktFXcRXWyeEFCMzYebSUY3u9FwLkj0wgxy3t5oBQ1EPAN3rT/wuod6wSilfHb79mFZPOWSjDW5BshP03K79ZRQ1Kxs/NMKfQ/nEAc7w3ub/Bf8EMRA3MigJA+uQg6L9gRofiAiDFt3Ogt8Q9ODlKDqAle4hOVL+eXb7okQbkvEXJSQuwXKkTCHwIgUgoxotivMJGtGbTgFgPNOMOTAh9AHrwyYwJuIsTKhFF7aJIUajQrt34KrgGyXVIe1zK9nHnr63jnNb/BL3u6BuzvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=OC2tmP+iPmFEfnLtf2GOUFD0npY00sj+R+dicYppryQ=; b=ed8v2Sr2kA8fFXGlFbcolskiVBAftve6kWL3huiSGpz3/rXfKem9IjxE0NljRs6zMwgYX4LhYmSIIaKbVuS0BZOnHBWkekU1jacQlMsCvazoQ9xoj+WSk93soRYe/OW3c1KJ90ZOZCO4lSHvV3IIMFiG40dVwhKMQJay4rgq8G3KZe06HGdd72APxLfUPq8eQabtLdGwM8auUXrOJci/SjMp0HsXwBXPT+U55j0rN3urXtdGUr+EnOkdVdH48djzLdLCLlKppHDE4SjGOm1UcylyhAP4yC5idDslKIzHmqpfJRs7IAvHjlPQb5m+IFojBagX8pUW7G7Qh+Yi2ngkaQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OC2tmP+iPmFEfnLtf2GOUFD0npY00sj+R+dicYppryQ=; b=oION9l26Wp2uxO255YBz/iL4eipPy5X0rP7IsK8kwkyMjpR313Fps255vLS2Pp9TWHP9Apa8gxczcIEOqwTWvwHKBXJN2yQ5X6/4LgvA3NTOuieT2OM9+kj61oCNakOMeFFbhpg1HCrZTaZLW8YS2CoI8CCEHoshe9CRL2UilxEq3x/7jThYZdYAp0eQVK0v+2jH8s1TdepZjRT2WU8ssZdjo1/sAKkt6vEafilrhDZpfYbIRnKPJS0kCY7UO23SCNwp4wED78zyOTs6C87FzMkMkP468SAEDfIrX/kDpKlAcB6FbPj7j72gZg0bzI3r/FuJVcO4CEmX4GSc6PlC2Q== Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) by AS4P250MB0416.EURP250.PROD.OUTLOOK.COM (2603:10a6:20b:4c3::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.43; Sun, 31 Mar 2024 05:31:31 +0000 Received: from GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d]) by GV1P250MB0737.EURP250.PROD.OUTLOOK.COM ([fe80::4a3b:cf76:cddc:c68d%4]) with mapi id 15.20.7409.042; Sun, 31 Mar 2024 05:31:31 +0000 From: Andreas Rheinhardt To: ffmpeg-devel@ffmpeg.org Date: Sun, 31 Mar 2024 07:31:16 +0200 Message-ID: X-Mailer: git-send-email 2.40.1 In-Reply-To: References: X-TMN: [DHpplYp2JncMXc82ZnQFVfxI74vXhqe6qqC/od6gKRQ=] X-ClientProxiedBy: ZR2P278CA0020.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:46::6) To GV1P250MB0737.EURP250.PROD.OUTLOOK.COM (2603:10a6:150:8e::17) X-Microsoft-Original-Message-ID: <20240331053123.293740-2-andreas.rheinhardt@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: GV1P250MB0737:EE_|AS4P250MB0416:EE_ X-MS-Office365-Filtering-Correlation-Id: 11521666-854b-4ef0-82ee-08dc5143d280 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VW/nyWr1EfNvQ2p6/UiamYWc8BDnh1Rv8pyEa14kkQYXHv7mot7V3KWfApKneL696QaGsOexRZRw5g3PahpezkYGuveu82Hpx2KdFgsTs/yWzuHvNL+txWivStLd2wzkxLX9drdutP8X5d8fDUfCi1EbrRe/AbYro0XDBbFcEm9Bo2NSfpNWC8Tyj/h0/Mcy7FGEEMS7uvNJhNnuBM6+GvhulakeqE/XrXoc/znr0itLKxi5g7GMNgRcri0jLSjwFeoVH+KQAFCVjSm6+5fTV6TaaIawUix1pxUNum8Ry+OuFchB4qv7Jy67JBQ88AGtlh+dIZNl3aHrjlbiV7e9sh7/gIqM0+tQ/uG5rCsZ2XgDkxhM6Y5UQuLu3n7IiqpLJ0Kc98KBQFvqBPrqpk7ZegdBJUGKdbWLklwzZBXUBXj3/vJUmQaNk+TR8UhGV6P2LSp7qOMlKGCAELiom0YfAcrtWy5/68mUxB7F2daxU/NDSBaXX2WIqsihvXEFq7u73hgAPIlHhmjW0geUuyFHW3ueUy0XtpcocqkT9WKTZlJoLQBRTWgfOsg29Fya95uaZLHi/jl0i3czPcRDjQJo5JSF5LdxvcM4u4IYObwgFxHUn+JLXJ0FGt1o6EHOdaor X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 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Tj2e/L0Yqi17/skETfZoSuuqXTZnKfrBeI0i9IAFhYqztReytB74k8cHIFjEX1arPrNQ+VZW3iACvpt0ECCzxc6aO4rSY81gtJ/V65XnAF/ZHwE4z6Rvt+sOhnRckOLZ82wN6idDgVj/v4yoj6SCyqM3xecly2uE5ZJ9bXXiVDC62l/yBx3s3KrxcOxbEhg+yxGUfXOBgZVIkBYkxI+Z5TwtLcGBEIJzl9Z3MlACfAt8FYUCBupvMvMyA4OZqQnoWVCDWU1w== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11521666-854b-4ef0-82ee-08dc5143d280 X-MS-Exchange-CrossTenant-AuthSource: GV1P250MB0737.EURP250.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2024 05:31:31.7778 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS4P250MB0416 Subject: [FFmpeg-devel] [PATCH 03/10] avfilter/avfilter: Use AV_DICT_DONT_STRDUP_(KEY|VAL) when possible 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 Cc: Andreas Rheinhardt Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: GFxrQYH9z27Z Signed-off-by: Andreas Rheinhardt --- libavfilter/avfilter.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 856862a393..508fe1b26b 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -844,6 +844,7 @@ int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, while (*args) { const char *shorthand = NULL; + int additional_flags = 0; if (priv_class) o = av_opt_next(&priv_class, o); @@ -869,7 +870,7 @@ int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, args++; if (parsed_key) { key = parsed_key; - + additional_flags = AV_DICT_DONT_STRDUP_KEY; /* discard all remaining shorthand */ if (priv_class) while ((o = av_opt_next(&priv_class, o))); @@ -879,10 +880,8 @@ int ff_filter_opt_parse(void *logctx, const AVClass *priv_class, av_log(logctx, AV_LOG_DEBUG, "Setting '%s' to value '%s'\n", key, value); - av_dict_set(options, key, value, AV_DICT_MULTIKEY); - - av_free(value); - av_free(parsed_key); + av_dict_set(options, key, value, + additional_flags | AV_DICT_DONT_STRDUP_VAL | AV_DICT_MULTIKEY); } return 0;