From patchwork Thu Aug 29 08:50:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51220 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:402a:b0:48e:c0f8:d0de with SMTP id ky42csp208352vqb; Thu, 29 Aug 2024 01:52:20 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUZDWw0R1IIR6H/kpcqGuQ+ELraNvS3UdLQlOnMRMDgCWw9rhHw+z7NJYg6rKkQmUCBR+kBOnun8A0JqV+dJlz9@gmail.com X-Google-Smtp-Source: AGHT+IF9RH4W+ZoIJWnXUgZMlhDSu4KiCWoKrdJ3AhAzEuUWkBU8cJk/QlmMEpkD7Oy1BVifDWnu X-Received: by 2002:a05:6512:1047:b0:530:e0fd:4a92 with SMTP id 2adb3069b0e04-5353e2f9401mr807212e87.0.1724921539913; Thu, 29 Aug 2024 01:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724921539; cv=none; d=google.com; s=arc-20240605; b=iHkgXXIPH3ahz9K31qWi8EPSgHbU4wDZuId/RW9+ss73BHlWRNHjqa3C/EkH3gNhU+ BPSpThhWaPeiclNI0jO4Innp63UyO6LDNHoAQFsN0dVEjNYNVDB5JnRuoZKv150Kofzt 2inq68unpZ+dS3KJI1GxmfWjYiEAFNnWi+5sG7Lo0q1vXJp3NVFyXWUE066B4m1sLdFj MEs5rj/Vm5CORiRgeNbegszhuLbdWGXc0pli5XUYYPTUb+A1Eq9SQBTrnOj3OSZD/hye F0ooiC85KgAxECFl7na7pWFz8PZougWSd6MAZZER2dwMn650HUZVGVj4quSy6M8hxpGn E/dQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; 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:dkim-signature:delivered-to; bh=EDKEuDknOxEy4lfpNlGvSyvCsRPrtqewJkLkbA/d0s0=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=Nwk1sb+wWqDHjlBqZPxC4Xjkk7iXwvKHgpavoeHv+OkKtxPCKY9Lik6yi2JLNEYsYJ 4C/kj0/intHHqmeDtghKJ3gMAk2p9dxLG/DcPwDgJpug2l8foSwAVu5yUpR1KNM+h6Wr fAGBnvlJYdpmDbhC6iGHIq+W5/QRl4VuVG5joyWjNAXYKKI+me5Bk4dxE6xPmiLW9aOo IrPA3PyczQGnUoTsCQlUbEsihnnEFXRhHagz4nm3i/QZOvb9wdnQ4of3dbyTiaihTGmk cwdRFBpRVCjoR2CsahSpL68BZYqzLhd4amdZa64ENRT+IMnXpXUecFJFMvwkSjKGDlNs yIYQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@khirnov.net header.s=mail header.b=gsUXOr9H; 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 2adb3069b0e04-5354077cf22si354518e87.28.2024.08.29.01.52.19; Thu, 29 Aug 2024 01:52:19 -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=@khirnov.net header.s=mail header.b=gsUXOr9H; 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 1F14568DCA3; Thu, 29 Aug 2024 11:52:04 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail1.khirnov.net (quelana.khirnov.net [94.230.150.81]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6186668DC7D for ; Thu, 29 Aug 2024 11:51:56 +0300 (EEST) Authentication-Results: mail1.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=gsUXOr9H; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id E49414DF5 for ; Thu, 29 Aug 2024 10:51:55 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id S01rnx96Rnj9 for ; Thu, 29 Aug 2024 10:51:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1724921514; bh=aIEygFaQKDs8a7PYIkY/yCONWQ+s0YOuAZ+NyGedrXM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=gsUXOr9HLJI/BneXAFGaR8avWOBODxILQqNpeyH7BlWjAfHVV6r5QmQm4MyMyQ7EX no71SnBqRoDIAlB0D8fd2UUMrQqkPtjmBiXWdBptWOczCksgIMKOAK8yc2u8Zu2JNw OhUM405CIJEIqy77hV6iwvRs/iMzTG1s7esC+Gy+nT5JC/kvoJmaYTCg8BiU9TOMQk UVJbbtljBiWOFE9X8WuIOuSYk+2ypTfD44/KF/+B6N0B3bELy51ce9qL90aeT+DlCp 6wQKJtswiE2MREl0mZP/v+y89pmKSkU+lNdlQtV90vONsL2O9HcNamEGv9jnlg1Da+ +CocKAb6FmySw== 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 mail1.khirnov.net (Postfix) with ESMTPS id 744854DF8 for ; Thu, 29 Aug 2024 10:51:54 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 3606D3A170F for ; Thu, 29 Aug 2024 10:51:48 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 29 Aug 2024 10:50:47 +0200 Message-ID: <20240829085052.533-3-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240829085052.533-1-anton@khirnov.net> References: <20240829085052.533-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/8] lavfi/af_aap: convert to query_func2() 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: CxvReHCHOuFu Drop redundant ff_set_common_all_channel_counts() / ff_set_common_all_samplerates() calls, since those happen implicitly in generic code. --- libavfilter/af_aap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_aap.c b/libavfilter/af_aap.c index 352f10cd8c..05608d7fbb 100644 --- a/libavfilter/af_aap.c +++ b/libavfilter/af_aap.c @@ -95,9 +95,11 @@ static const AVOption aap_options[] = { AVFILTER_DEFINE_CLASS(aap); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AudioAPContext *s = ctx->priv; + const AudioAPContext *s = ctx->priv; static const enum AVSampleFormat sample_fmts[3][3] = { { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, AV_SAMPLE_FMT_NONE }, { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, @@ -105,13 +107,11 @@ static int query_formats(AVFilterContext *ctx) }; int ret; - if ((ret = ff_set_common_all_channel_counts(ctx)) < 0) + if ((ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, + sample_fmts[s->precision])) < 0) return ret; - if ((ret = ff_set_common_formats_from_list(ctx, sample_fmts[s->precision])) < 0) - return ret; - - return ff_set_common_all_samplerates(ctx); + return 0; } static int activate(AVFilterContext *ctx) @@ -325,7 +325,7 @@ const AVFilter ff_af_aap = { .activate = activate, FILTER_INPUTS(inputs), FILTER_OUTPUTS(outputs), - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_SUPPORT_TIMELINE_INTERNAL | AVFILTER_FLAG_SLICE_THREADS, .process_command = ff_filter_process_command,