From patchwork Thu Dec 15 03:39:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 1802 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp527224vsa; Wed, 14 Dec 2016 19:39:40 -0800 (PST) X-Received: by 10.194.171.200 with SMTP id aw8mr117866wjc.79.1481773180017; Wed, 14 Dec 2016 19:39:40 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id i125si10520787wmg.121.2016.12.14.19.39.37; Wed, 14 Dec 2016 19:39:39 -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 C205E689A91; Thu, 15 Dec 2016 05:39:24 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D1A19687991 for ; Thu, 15 Dec 2016 05:39:17 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B28AC100C4B; Thu, 15 Dec 2016 04:39:23 +0100 (CET) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7zA07nQM4Pda; Thu, 15 Dec 2016 04:39:22 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 1E91A1013BC; Thu, 15 Dec 2016 04:39:22 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Thu, 15 Dec 2016 04:39:19 +0100 Message-Id: <20161215033919.2870-2-cus@passwd.hu> X-Mailer: git-send-email 2.10.2 In-Reply-To: <20161215033919.2870-1-cus@passwd.hu> References: <20161215033919.2870-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 2/2] avfilter/af_amerge: do not guess an output channel 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 Cc: Marton Balint MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" This is the right thing to do, but I am afraid this will break too many existing filter chains. How can we implement this properly? Ideas/options: - change it, break it, users will fix it - add a guess_output_layout option which will be true for now, false after a major bump, and mention this incompatible change in the next release - add amerge2 filter, deprecate amerge filter Signed-off-by: Marton Balint --- libavfilter/af_amerge.c | 4 +--- tests/ref/fate/filter-amerge | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c index 3bc7d89..43a2d95 100644 --- a/libavfilter/af_amerge.c +++ b/libavfilter/af_amerge.c @@ -114,9 +114,7 @@ static int query_formats(AVFilterContext *ctx) "output layout will be determined by the number of distinct input channels\n"); for (i = 0; i < nb_ch; i++) s->route[i] = i; - outlayout = av_get_default_channel_layout(nb_ch); - if (!outlayout && nb_ch) - outlayout = 0xFFFFFFFFFFFFFFFFULL >> (64 - nb_ch); + outlayout = FF_COUNT2LAYOUT(nb_ch); } else { int *route[SWR_CH_MAX]; int c, out_ch_number = 0; diff --git a/tests/ref/fate/filter-amerge b/tests/ref/fate/filter-amerge index b3e5eb5..8118b4e 100644 --- a/tests/ref/fate/filter-amerge +++ b/tests/ref/fate/filter-amerge @@ -2,8 +2,8 @@ #media_type 0: audio #codec_id 0: pcm_s16le #sample_rate 0: 44100 -#channel_layout 0: 3 -#channel_layout_name 0: stereo +#channel_layout 0: 0 +#channel_layout_name 0: 2 channels 0, 0, 0, 2048, 8192, 0x120efa65 0, 2048, 2048, 2048, 8192, 0x7b3cebf7 0, 4096, 4096, 2048, 8192, 0x0fb8ee01