From patchwork Mon Sep 5 23:13:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Niedermayer X-Patchwork-Id: 442 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.140.134 with SMTP id o128csp308561vsd; Mon, 5 Sep 2016 16:17:42 -0700 (PDT) X-Received: by 10.28.23.141 with SMTP id 135mr18311669wmx.100.1473117462854; Mon, 05 Sep 2016 16:17:42 -0700 (PDT) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id o3si27688866wjx.202.2016.09.05.16.17.42; Mon, 05 Sep 2016 16:17:42 -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; 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 B56ED689E57; Tue, 6 Sep 2016 02:17:25 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from vie01a-dmta-pe02-2.mx.upcmail.net (vie01a-dmta-pe02-2.mx.upcmail.net [62.179.121.158]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 4CB22689D82 for ; Tue, 6 Sep 2016 02:17:19 +0300 (EEST) Received: from [172.31.216.43] (helo=vie01a-pemc-psmtp-pe01) by vie01a-dmta-pe02.mx.upcmail.net with esmtp (Exim 4.87) (envelope-from ) id 1bh38p-0008SM-Qt for ffmpeg-devel@ffmpeg.org; Tue, 06 Sep 2016 01:17:27 +0200 Received: from localhost ([213.47.41.20]) by vie01a-pemc-psmtp-pe01 with SMTP @ mailcloud.upcmail.net id fzHS1t00g0S5wYM01zHTfH; Tue, 06 Sep 2016 01:17:27 +0200 X-SourceIP: 213.47.41.20 From: Michael Niedermayer To: FFmpeg development discussions and patches Date: Tue, 6 Sep 2016 01:13:53 +0200 Message-Id: <20160905231353.32269-2-michael@niedermayer.cc> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160905231353.32269-1-michael@niedermayer.cc> References: <20160905231353.32269-1-michael@niedermayer.cc> Subject: [FFmpeg-devel] [PATCH 2/2] avfilter/fifo: Make independent of the 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Michael Niedermayer --- libavfilter/fifo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libavfilter/fifo.c b/libavfilter/fifo.c index f0b77ff..abfbba1 100644 --- a/libavfilter/fifo.c +++ b/libavfilter/fifo.c @@ -104,7 +104,7 @@ static void queue_pop(FifoContext *s) static void buffer_offset(AVFilterLink *link, AVFrame *frame, int offset) { - int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout); + int nb_channels = link->channels; int planar = av_sample_fmt_is_planar(link->format); int planes = planar ? nb_channels : 1; int block_align = av_get_bytes_per_sample(link->format) * (planar ? 1 : nb_channels); @@ -129,7 +129,7 @@ static void buffer_offset(AVFilterLink *link, AVFrame *frame, static int calc_ptr_alignment(AVFrame *frame) { int planes = av_sample_fmt_is_planar(frame->format) ? - av_get_channel_layout_nb_channels(frame->channel_layout) : 1; + av_frame_get_channels(frame) : 1; int min_align = 128; int p; @@ -170,7 +170,7 @@ static int return_audio_frame(AVFilterContext *ctx) buffer_offset(link, head, link->request_samples); } } else { - int nb_channels = av_get_channel_layout_nb_channels(link->channel_layout); + int nb_channels = link->channels; if (!s->out) { s->out = ff_get_audio_buffer(link, link->request_samples);