From patchwork Thu Sep 5 10:07:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 51374 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:612c:f31:b0:48e:c0f8:d0de with SMTP id kb17csp294240vqb; Thu, 5 Sep 2024 03:34:13 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU+Qpr9m2sPiKusS+x5zndeUyWdaTQnnQpHJVyEOlZkJLYQdRNaMVzlY3KJGmNnepYjrysGLwrUvrJbm5tXevyT@gmail.com X-Google-Smtp-Source: AGHT+IFEVyBBb2tYwGaDUXAp2hv6b5dyf8KmbVKEE9ymDrHu6vnnC49oxI8KxEQHRKnfX83vaP+f X-Received: by 2002:a05:6512:224a:b0:52f:e5:3765 with SMTP id 2adb3069b0e04-53546b8f4c7mr8274737e87.6.1725532452704; Thu, 05 Sep 2024 03:34:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725532452; cv=none; d=google.com; s=arc-20240605; b=jJk7enEOnZ9RajIH4aoq3CtFtmFZn9RlpHG6UbM301t/wtQJJu+MUynBcmizwBZ0hh NP3Qy4OD1CZf2GY/bYViW7cHeKmBLXJoEK7e/tUHtVRnRYcRDoarLYNl90t7zfqhn7BI YAdFJOq6CNs8qFaggd1J9u+TRloHRfJmca8Hs0tpyAZDMRNg4DhblOFHnf+k7AO8P99I ov0RsgKs8ufHi/KP+EoIT4TIilb/ACd5n3N9n/++gZIKoKITe4U04ovYYruPYqsWdcxo Apz4JQ6NNwhnmvDI4eYyFIvKwxrKMdUuLV2mLutbql3N7QSwia0748oBBWb5anjAeSv/ mGLg== 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=ADNyT6QN1nmOBjHrAUkxbjHW/NlR1sy+rJONqy5rias=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=RorDroQWRC9DcAdesKONX1ZjB9ZFE4i2GzpH4uN9v48WhYFdhO0CNP9bPkfVooLmQo ewgnCHUIirOjYraiB1mOxNok2cyNNwM8NfyFKVwDTuWSqIyFW5PFfiZB6f2Ntj0nXbI1 LkJ6Uq8W0yNTKJFiy4NI10yEwSJ1vww2uRnzkdEFHJYfmjdWseDhm9SaIczgrcvjDpmD Vu3MugUtkFx+pkMye6S9o2VbnAmKo1/qzw8Q15O3slTWjYmsxPZA0z9pud7Qt57osdYp mQ6RZtxg6xJVgKH9/LITVibpAZNUmOlnJ/OhqB+KySM6qEMURi/2mK1ksPkfqaMfLnz0 SLPQ==; 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=h6kLFwn0; 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-535407eb8afsi5772374e87.327.2024.09.05.03.34.12; Thu, 05 Sep 2024 03:34:12 -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=h6kLFwn0; 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 9641C68DF6A; Thu, 5 Sep 2024 13:08:13 +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 37BD168DD28 for ; Thu, 5 Sep 2024 13:07:49 +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=h6kLFwn0; dkim-atps=neutral Received: from localhost (mail1.khirnov.net [IPv6:::1]) by mail1.khirnov.net (Postfix) with ESMTP id 1657B4E25 for ; Thu, 5 Sep 2024 12:07:46 +0200 (CEST) Received: from mail1.khirnov.net ([IPv6:::1]) by localhost (mail1.khirnov.net [IPv6:::1]) (amavis, port 10024) with ESMTP id u9_K2CL_UpE2 for ; Thu, 5 Sep 2024 12:07:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=khirnov.net; s=mail; t=1725530862; bh=3oKvmbYBpaSgCAQi929MqquBrmErvUpIu9od3DxkdNk=; h=From:To:Subject:Date:In-Reply-To:References:From; b=h6kLFwn0pTxyxVCo7mDvAZ9UHYiQPRznsCO++a9bUraJ/IztXoyFOD0D/Pu9Bynwh ypZapNKyZgU8bwNZm26zP04+ciCLsIRMEx+VXGxfAxkmYggZpRNEsVK0WpTdruJmRg 8fHv6DOkPA3vcWW1UCzL7xKLCmR+f0xzQBYC7n7NLkYntdwHXqDD9Ma7db+LGY++ix qAHVcWEe70uOlDFaSK9mA5txidoFmKIo6b1+VOJbMYnXk+tSDF9SAjBhWBS7MLIxEm DIgi/SpSn2sTf20K/9NEtru7/x6NXwmino6KD32T8qG086zaG4EIY4P6y6j1/BUCRx w42Su0wjrCD8w== 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 CBFAB4DF1 for ; Thu, 5 Sep 2024 12:07:42 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id E99D13A181C for ; Thu, 05 Sep 2024 12:07:35 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Thu, 5 Sep 2024 12:07:08 +0200 Message-ID: <20240905100729.6030-4-anton@khirnov.net> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240905100729.6030-1-anton@khirnov.net> References: <20240905100729.6030-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 04/25] lavfi/af_channelsplit: 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: YwsjTP1rb6YF Also, drop a redundant call that also happens implicitly in generic code. --- libavfilter/af_channelsplit.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/af_channelsplit.c b/libavfilter/af_channelsplit.c index 527c197fa6..64b6c7a1e1 100644 --- a/libavfilter/af_channelsplit.c +++ b/libavfilter/af_channelsplit.c @@ -118,18 +118,20 @@ static av_cold void uninit(AVFilterContext *ctx) av_freep(&s->map); } -static int query_formats(AVFilterContext *ctx) +static int query_formats(const AVFilterContext *ctx, + AVFilterFormatsConfig **cfg_in, + AVFilterFormatsConfig **cfg_out) { ChannelSplitContext *s = ctx->priv; AVFilterChannelLayouts *in_layouts = NULL; int i, ret; - if ((ret = ff_set_common_formats(ctx, ff_planar_sample_fmts())) < 0 || - (ret = ff_set_common_all_samplerates(ctx)) < 0) + ret = ff_set_common_formats2(ctx, cfg_in, cfg_out, ff_planar_sample_fmts()); + if (ret < 0) return ret; if ((ret = ff_add_channel_layout(&in_layouts, &s->channel_layout)) < 0 || - (ret = ff_channel_layouts_ref(in_layouts, &ctx->inputs[0]->outcfg.channel_layouts)) < 0) + (ret = ff_channel_layouts_ref(in_layouts, &cfg_in[0]->channel_layouts)) < 0) return ret; for (i = 0; i < ctx->nb_outputs; i++) { @@ -156,7 +158,7 @@ static int query_formats(AVFilterContext *ctx) if (ret < 0) return ret; - ret = ff_channel_layouts_ref(out_layouts, &ctx->outputs[i]->incfg.channel_layouts); + ret = ff_channel_layouts_ref(out_layouts, &cfg_out[i]->channel_layouts); if (ret < 0) return ret; } @@ -249,6 +251,6 @@ const AVFilter ff_af_channelsplit = { .uninit = uninit, FILTER_INPUTS(ff_audio_default_filterpad), .outputs = NULL, - FILTER_QUERY_FUNC(query_formats), + FILTER_QUERY_FUNC2(query_formats), .flags = AVFILTER_FLAG_DYNAMIC_OUTPUTS, };