From patchwork Sun Dec 4 13:24:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 1672 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.86 with SMTP id o83csp1172949vsa; Sun, 4 Dec 2016 05:25:35 -0800 (PST) X-Received: by 10.194.158.100 with SMTP id wt4mr55452093wjb.148.1480857935047; Sun, 04 Dec 2016 05:25:35 -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 kw6si11643459wjb.292.2016.12.04.05.25.34; Sun, 04 Dec 2016 05:25: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; 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 412E5689E64; Sun, 4 Dec 2016 15:25:18 +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 69112689E03 for ; Sun, 4 Dec 2016 15:25:12 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A5501100C6B; Sun, 4 Dec 2016 14:25:21 +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 xLRCtrJ9wp-s; Sun, 4 Dec 2016 14:25:20 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 4AC15100B4A; Sun, 4 Dec 2016 14:25:20 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Sun, 4 Dec 2016 14:24:56 +0100 Message-Id: <20161204132457.5910-2-cus@passwd.hu> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161204132457.5910-1-cus@passwd.hu> References: <20161204132457.5910-1-cus@passwd.hu> Subject: [FFmpeg-devel] [PATCH 2/3] lavfi/af_channelmap: add support for unknown input channel layouts 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" Signed-off-by: Marton Balint --- libavfilter/af_channelmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index dcae2a2..cdd8a58 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -291,7 +291,7 @@ static int channelmap_query_formats(AVFilterContext *ctx) AVFilterChannelLayouts *channel_layouts = NULL; int ret; - layouts = ff_all_channel_layouts(); + layouts = ff_all_channel_counts(); if (!layouts) { ret = AVERROR(ENOMEM); goto fail; @@ -316,7 +316,7 @@ static int channelmap_filter_frame(AVFilterLink *inlink, AVFrame *buf) AVFilterContext *ctx = inlink->dst; AVFilterLink *outlink = ctx->outputs[0]; const ChannelMapContext *s = ctx->priv; - const int nch_in = av_get_channel_layout_nb_channels(inlink->channel_layout); + const int nch_in = inlink->channels; const int nch_out = s->nch; int ch; uint8_t *source_planes[MAX_CH]; @@ -363,7 +363,7 @@ static int channelmap_config_input(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; ChannelMapContext *s = ctx->priv; - int nb_channels = av_get_channel_layout_nb_channels(inlink->channel_layout); + int nb_channels = inlink->channels; int i, err = 0; const char *channel_name; char layout_name[256]; @@ -378,7 +378,7 @@ static int channelmap_config_input(AVFilterLink *inlink) if (m->in_channel_idx < 0 || m->in_channel_idx >= nb_channels) { av_get_channel_layout_string(layout_name, sizeof(layout_name), - 0, inlink->channel_layout); + nb_channels, inlink->channel_layout); if (m->in_channel) { channel_name = av_get_channel_name(m->in_channel); av_log(ctx, AV_LOG_ERROR,