From patchwork Wed May 10 19:22:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Constantino X-Patchwork-Id: 3643 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.3.129 with SMTP id 123csp367303vsd; Wed, 10 May 2017 12:30:44 -0700 (PDT) X-Received: by 10.223.164.15 with SMTP id d15mr5227440wra.20.1494444644776; Wed, 10 May 2017 12:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1494444644; cv=none; d=google.com; s=arc-20160816; b=h9RrpqvrSJoCmfX4a9F/B8zz7/v6A34wkGlD3HpGv++JJo1W7GDOryiyOhX6HtGvJd kJDsYw7FpHk6+PlfW1MCALWzsswoVetFTbvflIoryvxFknenFIHRbrsb1ioGVY9xlfsk pz71SX6R7enRpiN6BIexXxIQROESOMZd1/O9U86P0tm6me160zZ9THpKFUmSH/WoWNpS 69Lqfe50MVSP+GPBj6d8re5a+zguDaPXbDL2BTLBqU42tbnpJmjez9813XubrHPjaHjq SN2vof3hBk9U40YldGPb/SkF84cPvXL4DKlsOuRPM5YB7oBYsJKrNulX5H9kH1BzHl7V 1L8Q== 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:dkim-signature :delivered-to:arc-authentication-results; bh=lr3XiQ9RNYoP1MpE6KgfhApaGkWwsx8ZFZLnHTwEwJM=; b=nx61rRXYD8w8GL79vzZdumqMtsBgJom0dAqOcDIXjGZMBnIJoH9Xv8fTif+ldN5/TC GqVB/0Z4ZNwNd3xRXih4j5WL9APuOuXugxcVCSwPJGfBzzS3ma0MOuEe1FKUMW0QcL/w nRL5QmMeBFc/2blxmeVPwdYBhVKKxU3hHIwyoWELuPVKGRgnxOLmHoaB88Z6DDsfClL/ 4Gan4M4ZoupsNkdibYWgotWjss5T7lSZ75UwM8HJUEZadYQ+DB83QOEPZb4X23PjLPW3 bN9xWDHlRuNnxzGue5wtawqmBxiDYyNekrj1SSIUd1Yu/uRdBHW0BzF5EZh9USBXyQn4 5rMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.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; dmarc=fail (p=NONE sp=NONE 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 j39si3936173wre.322.2017.05.10.12.30.43; Wed, 10 May 2017 12:30:44 -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=@gmail.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; dmarc=fail (p=NONE sp=NONE 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 75BD16883C3; Wed, 10 May 2017 22:30:34 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id DB9B66883A4 for ; Wed, 10 May 2017 22:30:27 +0300 (EEST) Received: by mail-wr0-f193.google.com with SMTP id g12so721841wrg.2 for ; Wed, 10 May 2017 12:30:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=4BbELwjCXD6uHExMWS9rgssgbNwpke0fpLLf3PeohtI=; b=L26cFo+JIvNR2bwqJKOYc0f3ZC2+TiMOr+gdf+Rc11x8gwlyHJB9oNriBDmXAiN2LG EmWsTcw1MdjMG14lNU7AZlWOEJZZApJQwLB3HILt3enLoMelyZtBGnVEDXDozKJgcgs+ FY4BPq3+xO7Q+OlvgsFheEoifh7gDj7JLP1rR8guQV4Q8xtN719w654cq+DOB64CA/1R Ab/Vmt5IRLzv7zuFSaO6DOCf6/QKOpyuiz7/HisYEU3d40GvtuivJLeCKr5100HtKAmL LxAt5FKtmj3LhZLYkp4c7oSfdWWt1ykOjqHyFrzaZ9c4+8P5AJxBkRmVaxV8xz11ZM+1 s3Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=4BbELwjCXD6uHExMWS9rgssgbNwpke0fpLLf3PeohtI=; b=LsFu9l7XQ3gau8xMV6DPZYfEcqJgpFeW2KwV8LeJ+WPrxuUOz0v5t/z8MFjAAbtMuk sr4b8GF+iFBOrFdSx15IuENaRTDyKwfju5saHxKeRMLohwT0QYdO8i4KW15sTXO1mVHU d0URc6ryWVhuaJxLi414Z+pHDkkzEmcdDDMQzxxLk6ItbjSYYY/mR3Wbz5Mihhv4HuXC 0xRGznv3uxysindqJK3dZVrblTn1hQlM2P+TSEGCYmiWqfaZpja75DS37cktXnr25ETQ pni+ZOtp47NbgNNonF5YBn8YCT6p4ebk/RB0hdPI9zKQoDCx4Hic+5i9IJy4WGHqs/Bd vY8Q== X-Gm-Message-State: AODbwcCWzX6mIJ0kcCAXiVs6FYVJMcjx7KnPQHIgndThRxv37N4rDIFy 0pq4942SIEgisA== X-Received: by 10.223.138.139 with SMTP id y11mr5290622wry.22.1494444131357; Wed, 10 May 2017 12:22:11 -0700 (PDT) Received: from localhost.localdomain (10.246.114.89.rev.vodafone.pt. [89.114.246.10]) by smtp.gmail.com with ESMTPSA id u76sm3813393wrb.27.2017.05.10.12.22.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 May 2017 12:22:10 -0700 (PDT) From: Ricardo Constantino To: ffmpeg-devel@ffmpeg.org Date: Wed, 10 May 2017 20:22:02 +0100 Message-Id: <20170510192202.29800-1-wiiaboo@gmail.com> X-Mailer: git-send-email 2.12.1 Subject: [FFmpeg-devel] [PATCH] avfilter/af_pan: ignore named channels not in current layout 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" instead of erroring out. af pan=stereo|FL=FL|FR=FR|FC=FC would error because there's no Front Center in stereo layout. This allows just changing the output channel layout and keeping the same channel configuration across more than one output. Example usecase * changing balance to the right-side channels for stereo and 7.1 before: pan=stereo|FL=0.2*FL+0.8*FR|FR=0*FL+1*FR pan=7.1|FL=0.2*FL+0.8*FR|FR=0.0*FL+1.0*FR|FC=FC|LFE=LFE|BL=0.2*BL+0.8*BR|BR=0.0*BL+1.0*BR|SL=0.2*SL+0.8*SR|SR=0.0*SL+1.0*SR after: pan=stereo|FL=0.2*FL+0.8*FR|FR=0.0*FL+1.0*FR|FC=FC|LFE=LFE|BL=0.2*BL+0.8*BR|BR=0.0*BL+1.0*BR|SL=0.2*SL+0.8*SR|SR=0.0*SL+1.0*SR pan=7.1|FL=0.2*FL+0.8*FR|FR=0.0*FL+1.0*FR|FC=FC|LFE=LFE|BL=0.2*BL+0.8*BR|BR=0.0*BL+1.0*BR|SL=0.2*SL+0.8*SR|SR=0.0*SL+1.0*SR --- libavfilter/af_pan.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libavfilter/af_pan.c b/libavfilter/af_pan.c index 63d7750f35..9c44ba1cda 100644 --- a/libavfilter/af_pan.c +++ b/libavfilter/af_pan.c @@ -136,10 +136,9 @@ static av_cold int init(AVFilterContext *ctx) } if (named) { if (!((pan->out_channel_layout >> out_ch_id) & 1)) { - av_log(ctx, AV_LOG_ERROR, - "Channel \"%.8s\" does not exist in the chosen layout\n", arg0); - ret = AVERROR(EINVAL); - goto fail; + av_log(ctx, AV_LOG_VERBOSE, + "Channel \"%.8s\" does not exist in the chosen layout, skipping\n", arg0); + continue; } /* get the channel number in the output channel layout: * out_channel_layout & ((1 << out_ch_id) - 1) are all the