From patchwork Thu Feb 15 08:34:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Rapp X-Patchwork-Id: 7602 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.150.1 with SMTP id c1csp1854416jai; Thu, 15 Feb 2018 00:35:31 -0800 (PST) X-Google-Smtp-Source: AH8x2249dYdPf8EKIt+rozRd2NbtCWGqCMTMYGnQBKqvkcs8yxvk7UxSm+hbRqwUbW2IarWCSPwi X-Received: by 10.28.215.142 with SMTP id o136mr1246906wmg.101.1518683731345; Thu, 15 Feb 2018 00:35:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518683731; cv=none; d=google.com; s=arc-20160816; b=Y6hNznN917WMin7q6EUZzKwhcYmtr3ih6xJY+zZ0G7imk3SL4PshHRT7iIAYWoMlZX 8oi3j1ERbS9bjdCSQRnGvKG+hnJSuEFqaDweGbIoV44E9EmpSoEM/HzLCqhy/Yz5wGGf DrQeT8JJnyHDZvXXriUAMQeplcK6PbNf6O6rgp1mPRA1zCCCDybDmLtsSbA0ypZSaXUg o4dHMWIUdD0mU0yuiUgz5NXuU2hWY+jU83rTBxY4FuZAWCjmg1Swqz1MVlo4/KbovDlF S7+IqQVEpEJ/UMoxUVPCQWx1kfzRPaLZq5wK1KmBlD0zmkzmDWlpicsXSdXU5QHJC8YQ L/pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:delivered-to :arc-authentication-results; bh=N4un22GI+GjUmjUj7EBbxQaqHrH2r2JXzoZfgFGwkvA=; b=huLioBcrynNLYtmqvwRMA+R2YSRHE2gDlijMfS7P58IZn2h83/O/mTUhnwnVxDPyyG p/qrSx7tcLngq6FXmuls0i+k8yvd5zl9sHgI4wivuKwtFcz+lqmYRoOxGzUBDJeA7Zyw +oKitE+9T/YVi/zXn94fIL6N+iVIJAx8O5KYox9gTukJz4F5SE8lG5/DRyzaPhnL+nAd /XW4f/2Qm6PS19hrA5kSnCI5vE7DgzXcLAU8p5hsx+MAjSzy1ff2ixrNtU7eU5/omb8D atGzzekpNCCVBH8SAwlqO0S4FEZkEamEiNQt/qYE7dKwyBX/NAKtEyMj2FDnKJCPept/ t+6g== 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 a3si163400wme.45.2018.02.15.00.35.30; Thu, 15 Feb 2018 00:35:31 -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 06716689E8B; Thu, 15 Feb 2018 10:35:11 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mx01.mail.netstorage.at (mx01.mail.netstorage.at [89.207.144.13]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 23FC5689A98 for ; Thu, 15 Feb 2018 10:35:04 +0200 (EET) Received: from p1002.netstorage.at (p1002.netstorage.at [89.207.146.186]) by mx01.mail.netstorage.at (Postfix) with ESMTPS id 5179BA033F for ; Thu, 15 Feb 2018 09:34:57 +0100 (CET) Received: from mailix (noaport.de [46.237.252.213]) by p1002.netstorage.at (Postfix) with ESMTPA id D623281933 for ; Thu, 15 Feb 2018 09:34:56 +0100 (CET) Received: from frogstar-a.kuhnle.local (frogstar-a.kuhnle.local [192.168.0.26]) by mailix with ESMTPA ; Thu, 15 Feb 2018 09:34:56 +0100 From: Tobias Rapp To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Feb 2018 09:34:55 +0100 Message-Id: <1518683696-17786-1-git-send-email-t.rapp@noa-archive.com> X-Mailer: git-send-email 2.7.4 X-PPP-Message-ID: <20180215083457.25739.39953@p1002.netstorage.at> X-PPP-Vhost: noa-archive.com X-NetStorage-MailScanner-Information: Please contact the ISP for more information X-NetStorage-MailScanner-ID: 5179BA033F.A5396 X-NetStorage-MailScanner: Found to be clean X-NetStorage-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (nicht zwischen gespeichert, Wertung=-0.5, benoetigt 6, autolearn=not spam, BAYES_00 -0.50) X-NetStorage-MailScanner-From: t.rapp@noa-archive.com X-Spam-Status: No Subject: [FFmpeg-devel] [PATCH 1/2] swresample/rematrix: fix update of channel matrix if input or output layout is undefined X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Prefer direct in/out channel count values over channel layout, when available. Fixes a pan filter bug (ticket #6790). Signed-off-by: Tobias Rapp --- libswresample/rematrix.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libswresample/rematrix.c b/libswresample/rematrix.c index 9fcfff1..8227730 100644 --- a/libswresample/rematrix.c +++ b/libswresample/rematrix.c @@ -69,8 +69,10 @@ int swr_set_matrix(struct SwrContext *s, const double *matrix, int stride) return AVERROR(EINVAL); memset(s->matrix, 0, sizeof(s->matrix)); memset(s->matrix_flt, 0, sizeof(s->matrix_flt)); - nb_in = av_get_channel_layout_nb_channels(s->user_in_ch_layout); - nb_out = av_get_channel_layout_nb_channels(s->user_out_ch_layout); + nb_in = (s->user_in_ch_count > 0) ? s->user_in_ch_count : + av_get_channel_layout_nb_channels(s->user_in_ch_layout); + nb_out = (s->user_out_ch_count > 0) ? s->user_out_ch_count : + av_get_channel_layout_nb_channels(s->user_out_ch_layout); for (out = 0; out < nb_out; out++) { for (in = 0; in < nb_in; in++) s->matrix_flt[out][in] = s->matrix[out][in] = matrix[in];