From patchwork Wed Feb 8 17:37:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul B Mahol X-Patchwork-Id: 40331 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:5494:b0:bf:7b3a:fd32 with SMTP id i20csp5474240pzk; Wed, 8 Feb 2023 09:38:35 -0800 (PST) X-Google-Smtp-Source: AK7set9INdXBrjNNoskE0eQ+su6d7TwX5/hhb0EbgjN+9rg9iATKFHaXfqbC0tz4XOhmgGTBkFaA X-Received: by 2002:a17:907:2cc9:b0:88d:ba89:1839 with SMTP id hg9-20020a1709072cc900b0088dba891839mr3655821ejc.10.1675877915448; Wed, 08 Feb 2023 09:38:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675877915; cv=none; d=google.com; s=arc-20160816; b=0yk/FGYAOuasLLarxa3cLwMn8SDRZ0rYKTJfR23wiWymrYtC6QHeI0NG+KjNBwGN3w xHkQB1lMVaqK9rvNLGe7eVCRrrkYEmpbRDQ+wenv8gc/3juDwkHAvrrP/EC0APwOKdZg lmH41I3ro+v9aftN3TPT011lc0e8BD1OgIm4T1W9e39BoZNywfjy1rVzUrxpCmdE6g/F nSUKOVZrmC1vmiFbuqV4C8ydbOyfsXl2yEtIiyAtoiZY9dfp0H6/tShOa49VyHaP+G7x yce1sD3Qw6Legu48nxUowqq3ob3sr3XAeytga3Shpzbk3LJ3UpOSVGD+6MboXqRoIRae 2Ssg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence:subject:to :message-id:date:from:mime-version:dkim-signature:delivered-to; bh=O1lDa51YKzZ/dsnoVJkIvOR+6CL9jQlKAizs4eI+0SE=; b=xNc88JLERZib4g/ZF0ftZYQVu16Y10CEWge590f8R3ABTUv3uTur7fmD1eXIF+Nk7R wkUf2xrFrweaDlzmShglkjRoc67bX/cLbNtcZjYy/xABN7L6EaBSuaHKPvG0PgMh+Iku Im5eOkDvTAXnvFirsR9JNApbORxcJaGME5EDeiQA0EyAENpzqeAOYB2XmuKU4fw2Qhuk e8Qc4FZnJuWhw4CZYD7WUohAuHvPiv/2movxrAJJUCz/KKsccP5Hpg0VhgU33dDclbCV oRARuxXLARL9wj53qS8wj0pIIllq8mnNvDLCVesiIXUDZeIRWrICbOHF9A5/bZx0ROXm meMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=MrnFIuMK; 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=gmail.com Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id fb21-20020a1709073a1500b0089f801f771fsi12762984ejc.314.2023.02.08.09.38.29; Wed, 08 Feb 2023 09:38:35 -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; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20210112 header.b=MrnFIuMK; 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=gmail.com Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id F087268BED3; Wed, 8 Feb 2023 19:38:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-vs1-f43.google.com (mail-vs1-f43.google.com [209.85.217.43]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AFB2968BEC5 for ; Wed, 8 Feb 2023 19:38:17 +0200 (EET) Received: by mail-vs1-f43.google.com with SMTP id k6so20734915vsk.1 for ; Wed, 08 Feb 2023 09:38:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=pdARgSOTdxZng7WKBfIgtVEcKMX6KGqXc79XFH6Rk50=; b=MrnFIuMKF/w5YuD2vTHDGxowz8fbTiZEMlczWnnKbxIR9y6HF0GwcW2G0bkucrpigf vd25WUwMTnpc9JPF73b4DhEpO5vdfKiurDRVRtBLdhnm6MVfemWPO33MEcVDsgoGzXrA DnFrLwhwCSdC3+hRZL1we9pkIKlzThtb67Pn6Jx6BjoTPR7X6Qo0wTwzj4Y3QvxdaOry Yl8EOM1TB8iIvfB8VaqbazC/EzO/NwVaKjDNUBYYDNgC9EbhcBrPA3wTJxYeStboXAgN ES7uEcJCcehFg1PEOHOlDxsvXeau7t9t4VEL4yyB303ch+fd2OckiHrDrCTkEtoFvfUK LDJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pdARgSOTdxZng7WKBfIgtVEcKMX6KGqXc79XFH6Rk50=; b=P9UgPHRx3D9S24FJoeqta1m9k45UZH2DHBGieJ3uJNMnoretsvG7r9GU+Qr1ETXBNJ Ldz1HT2mktpUUwI4wE3RTJC/sr6/jJuQuHV8bXdTbo96hibgfilB6F3/5GOGvjQ+ING9 7vB5wh/3H0qvqhj04aOnY3cQgk1y9YCtFtGQK9yBaLd+/PpD2MQ+y77N4vsvin4KY7nh P9POdk9RWPQqSM3/LGceiJmGe6c3k2F+FVRnFMibL7EoPWak32CGdNDnc/BuU9OO6p4p 8sK6duhXtZ7aBeEHuTbgd2KCbw1TMz11sWlPgdWdOGQ9ro7yY3nFy2Rdck/M8Jg+128+ POdA== X-Gm-Message-State: AO0yUKVvedPPN6KZpeZkfCZxp67U49M+iRaRvxj3mBNhR3WNx4ghpT+G ewaQUfkKGimPz9l20d6WAjdUBXq2rnLeJLDOzRcERG0Q X-Received: by 2002:a67:b20f:0:b0:40e:251f:cdc0 with SMTP id b15-20020a67b20f000000b0040e251fcdc0mr2587044vsf.24.1675877895973; Wed, 08 Feb 2023 09:38:15 -0800 (PST) MIME-Version: 1.0 From: Paul B Mahol Date: Wed, 8 Feb 2023 18:37:58 +0100 Message-ID: To: FFmpeg development discussions and patches X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [FFmpeg-devel] [PATCH] swresample: try to fix regression 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: rQvmvLOoueok This one should pass FATE. From ca54f241756e764f70c919acd0c99c811762dcb1 Mon Sep 17 00:00:00 2001 From: Paul B Mahol Date: Wed, 8 Feb 2023 18:35:38 +0100 Subject: [PATCH] swresample: do not attempt to rematrix if channel map is provided Signed-off-by: Paul B Mahol --- libavfilter/af_pan.c | 6 +----- libswresample/swresample.c | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index 80c194b066..067f646805 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -313,9 +313,7 @@ static int config_props(AVFilterLink *link) pan->channel_map[i] = ch_id; } - av_opt_set_chlayout(pan->swr, "ichl", &link->ch_layout, 0); - av_opt_set_chlayout(pan->swr, "ochl", &pan->out_channel_layout, 0); - av_opt_set_int(pan->swr, "uch", link->ch_layout.nb_channels, 0); + av_opt_set_int(pan->swr, "uch", pan->nb_output_channels, 0); swr_set_channel_mapping(pan->swr, pan->channel_map); } else { // renormalize @@ -335,8 +333,6 @@ static int config_props(AVFilterLink *link) for (j = 0; j < link->ch_layout.nb_channels; j++) pan->gain[i][j] /= t; } - av_opt_set_chlayout(pan->swr, "ichl", &link->ch_layout, 0); - av_opt_set_chlayout(pan->swr, "ochl", &pan->out_channel_layout, 0); swr_set_matrix(pan->swr, pan->gain[0], pan->gain[1] - pan->gain[0]); } diff --git a/libswresample/swresample.c b/libswresample/swresample.c index 5884f8d533..7c8d9bfc97 100644 --- a/libswresample/swresample.c +++ b/libswresample/swresample.c @@ -312,9 +312,9 @@ av_cold int swr_init(struct SwrContext *s){ if (s->out_ch_layout.order == AV_CHANNEL_ORDER_UNSPEC) av_channel_layout_default(&s->out_ch_layout, s->out.ch_count); - s->rematrix = av_channel_layout_compare(&s->out_ch_layout, &s->in_ch_layout) || + s->rematrix = !s->channel_map && (av_channel_layout_compare(&s->out_ch_layout, &s->in_ch_layout) || s->rematrix_volume!=1.0 || - s->rematrix_custom; + s->rematrix_custom); if(s->int_sample_fmt == AV_SAMPLE_FMT_NONE){ if( av_get_bytes_per_sample(s-> in_sample_fmt) <= 2 -- 2.39.1