From patchwork Thu Aug 29 08:50:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51221 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:402a:b0:48e:c0f8:d0de with SMTP id ky42csp208428vqb; Thu, 29 Aug 2024 01:52:31 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUUHfejqL5IAHQJ9QR645FizarJuPYfLSvCzKeTYPmXfU+M6lChIVnN/XC3ABKVu+phAR3Hf2O8MvJy3aCtTWtq@gmail.com X-Google-Smtp-Source: AGHT+IENVDpFaFS/ph4TlwwkTGH1qmohuHnKtC255a34hR2ww2bxBVHGs008uMIkIKAAFIpC3lKe X-Received: by 2002:a2e:4e11:0:b0:2f4:3de7:ac48 with SMTP id 38308e7fff4ca-2f616895d57mr3552621fa.19.1724921551330; Thu, 29 Aug 2024 01:52:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1724921551; cv=none; d=google.com; s=arc-20240605; b=JuspSKpgvu+X5KBzXyjuESYCzZLXASLkfkOxp6q5pmkovNV0Thv7Le2CEzrywq/D+K IhOxFNeWOEbPqlsjuML1neykitrW79nkyABTLME2NIWE3U+MlBTZ3bANz5lCREj9ViJx oS40KoL65hldCsRQOhnFFEaappaMHZSCWANvxKMA1xVpYYSvbN1LvUEF4N2frX6WqtXE 3aTg7wPHkYrVyDu5RPSeDVkRStMMo4DLZ0qJWCeXMyY/rHVNnjWxrmQ0eaBLtAa7aJhX 64I9lpdceVEJKBZh+qJIMEFP7hs4Nvv8bEipTMsi3wHYSVPmtkhoU2+GhVHX93pfCJf8 aUiQ== 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=F9sKLst+oU+TlAaOTeN0oJyJNwpDPwMlvhnzRCJv4cs=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=VcOJGi5eRDpKKspBIzgsohGKcKaCvAMGfEK7KtIY9d+iOPiu9dBPFUItfCRzX+Un62 3UUvB7Gal5Pb8Ib9ubkMfyNhiiD024aU0mDzaGSVVXdA51XD59k7HzX2JuLMkZqhwuYQ 13xiWohPt5oeuRULO4Uk/dAQFU3cOEUN5sCM7c7EjIVvJBi7odeNxaevReFiChbKad+z bXUzkKxB3D0/3qbqViCrlAdxWNl8WKHNhiMhEvRHFEIpbKoCyHmEsqhwNXyoHFNtD5nv VVLFIQFnHG5MTqPSZchOHZzSIVKfINh0dKUMfThFOvx5qsEhrMw4Da1tOgMgHo08QISc SUtg==; 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=Yy8dq5JL; 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 38308e7fff4ca-2f6151881bdsi3494921fa.568.2024.08.29.01.52.30; Thu, 29 Aug 2024 01:52:31 -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=Yy8dq5JL; 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 6591868DCC1; Thu, 29 Aug 2024 11:52:05 +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 BF64968DC81 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=Yy8dq5JL; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 52F954DF8 for ; Thu, 29 Aug 2024 10:51:56 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id qKEaDe1JwV8q for ; Thu, 29 Aug 2024 10:51:56 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1724921514; bh=vqxfiiJvKhcOOKwH7lJNHKSfdt6spzGTdxSyIWS53f0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Yy8dq5JLdybt4SdAVyCmoszYPM0kPsDfN5TuV2PwulbkR3/EQwxq/jU6B2Hn+g+2M cp/J+gNsIP8u7TLeuRJjRMKGhz/Q4UBuQUEQh4+Tb05GT+u06XiGLwc43aEf1kuNnD lp9P4hmKCVLLID7+DA2/9jS3FzqkLBwPKTgc7nkaJaG0pXsuABHAFvTKQvemqiDmpK 6C82s9ZiVdtUA99AXG5ha697k9NpmJbCMjxMr8tphQP5blJuzuTqkWI8Aru14V+6Hm UYJ5zeYEPvGlQWiOwFJLwj66KXMuu7MpcbnSXCyvsQUJ/GZ7zCzG6uQiJseDqjmV4+ PLQzKmSPkoH4g== 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 75BCC4DFA 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 411B83A17C2 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:48 +0200 Message-ID: <20240829085052.533-4-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 4/8] lavfi/af_acrossover: 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: URSKAQhvDS21 Drop redundant ff_set_common_all_channel_counts() / ff_set_common_all_samplerates() calls, since those happen implicitly in generic code. --- libavfilter/af_acrossover.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libavfilter/af_acrossover.c b/libavfilter/af_acrossover.c index 48ff002006..3fd5c1d246 100644 --- a/libavfilter/af_acrossover.c +++ b/libavfilter/af_acrossover.c @@ -108,9 +108,11 @@ static const AVOption acrossover_options[] = { AVFILTER_DEFINE_CLASS(acrossover); -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { - AudioCrossoverContext *s = ctx->priv; + const AudioCrossoverContext *s = ctx->priv; static const enum AVSampleFormat auto_sample_fmts[] = { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_DBLP, @@ -121,9 +123,7 @@ static int query_formats(AVFilterContext *ctx) AV_SAMPLE_FMT_NONE }; const enum AVSampleFormat *sample_fmts_list = sample_fmts; - int ret = ff_set_common_all_channel_counts(ctx); - if (ret < 0) - return ret; + int ret; switch (s->precision) { case 0: @@ -138,11 +138,11 @@ static int query_formats(AVFilterContext *ctx) default: break; } - ret = ff_set_common_formats_from_list(ctx, sample_fmts_list); + ret = ff_set_common_formats_from_list2(ctx, cfg_in, cfg_out, sample_fmts_list); if (ret < 0) return ret; - return ff_set_common_all_samplerates(ctx); + return 0; } static int parse_gains(AVFilterContext *ctx) @@ -627,7 +627,7 @@ const AVFilter ff_af_acrossover = { .uninit = uninit, FILTER_INPUTS(inputs), .outputs = NULL, - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS | AVFILTER_FLAG_SLICE_THREADS, };