From patchwork Sun Jan 8 12:58:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 39922 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:bc95:b0:ad:ade2:bfd2 with SMTP id fx21csp2423593pzb; Sun, 8 Jan 2023 04:59:40 -0800 (PST) X-Google-Smtp-Source: AMrXdXu8otAsZxMGD/+4IAvtkipBHpU242mBro67XVzIjvTwxtWrdca+Ug3a0W9bsz7EzZsgCr8/ X-Received: by 2002:a05:6402:414:b0:495:77a9:f108 with SMTP id q20-20020a056402041400b0049577a9f108mr10937457edv.39.1673182780168; Sun, 08 Jan 2023 04:59:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673182780; cv=none; d=google.com; s=arc-20160816; b=sWUJlVsmtY3Nd6BNdqO6OmDZdVRQtv+KJ3BEJG3aTOsWnnMXAPhO/gdaAcZ6sX63Rj A0TkQ8W2b6jEMtlkBVLjnPSF35tFo/ET1MyKGFHRKbblE+jUE3zrBD8hGkkUK4/EGFbt vK6Jk1lWLlihRk2ceVaZT1kxL7j41/HQipF2vAWphu/ZuoZaM1ywnOPW8hXPJUxf8iEF qjinEnplwAPtPHVUr122aVN/Fc6NW/0yiYgq6Gw8U7VF95qrV7KWF//8MQoVOqsbFfFJ oRw/OZZ9splBx5fbty9YO6NNf4z6EU5hql73AbCyGnXB/DcdnR74sfQrk+OOn9mw5giX Gs7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:references:in-reply-to:message-id :date:to:from:delivered-to; bh=1jRKu1u0f84sFxh2u/8qsEAzvRbforybU+XZLYIuN4M=; b=ULXK1UtRCpobO2GraY+tZvn9VzHFi/qyHeQZGu4xlvSV+PhqtJjopUjHHKdCvvE8g5 yy2SrmWE1+VqJtKJWxZo6WXjoHw85LTWWHHtbqVy/IMfXocko9jmXdgcNR+ZG5d2YphV v177w7bFzt7LOD3tZDWApA04YiJL73Wk3J2AS/biF1Mys1hxYwG8zAlWxD81u9x3bLNg O3gWTohbAfb9VdnHjfJGJT+Pv4vs2BuWCl0zz3CZaCT/oYX+ERtEbVgA8S6EAF+rNI+j EgZlM8VoI8rQlfEy+pXPuHHmGKwHvYGcW82AvzQYAS+9c5eVPrpdCwlAPavlKAwJuf3V Um1g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id r18-20020a05640251d200b0046ffcd4df07si8064037edd.569.2023.01.08.04.59.39; Sun, 08 Jan 2023 04:59:40 -0800 (PST) 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; 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 Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4D8E568BC80; Sun, 8 Jan 2023 14:58:49 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2402D68BC50 for ; Sun, 8 Jan 2023 14:58:41 +0200 (EET) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id E010B2405F9 for ; Sun, 8 Jan 2023 13:58:36 +0100 (CET) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id 46d6V0s2mL5t for ; Sun, 8 Jan 2023 13:58:34 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (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 "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id C16C42404F8 for ; Sun, 8 Jan 2023 13:58:33 +0100 (CET) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 6D92D3A034C for ; Sun, 8 Jan 2023 13:58:26 +0100 (CET) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Sun, 8 Jan 2023 13:58:07 +0100 Message-Id: <20230108125811.17967-4-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20230108125811.17967-1-anton@khirnov.net> References: <20230108125811.17967-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/8] lavfi/avfilter: export a multikey dict from process_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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: XX/WHuP39NL6 This way the function does not need to be able to match keys to AVOptions, which will be useful in future commits. --- libavfilter/avfilter.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 689c91891e..278d5868de 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -850,17 +850,7 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options, return ret; } } else { - o = av_opt_find(ctx->priv, key, NULL, 0, - AV_OPT_SEARCH_CHILDREN | AV_OPT_SEARCH_FAKE_OBJ); - if (!o) { - av_log(ctx, AV_LOG_ERROR, "Option '%s' not found\n", key); - av_free(value); - av_free(parsed_key); - return AVERROR_OPTION_NOT_FOUND; - } - av_dict_set(options, key, value, - (o->type == AV_OPT_TYPE_FLAGS && - (value[0] == '-' || value[0] == '+')) ? AV_DICT_APPEND : 0); + av_dict_set(options, key, value, AV_DICT_MULTIKEY); } av_free(value);