From patchwork Tue Feb 21 06:58:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rostislav Pehlivanov X-Patchwork-Id: 2623 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.65.149 with SMTP id x21csp261590vsf; Mon, 20 Feb 2017 23:06:09 -0800 (PST) X-Received: by 10.28.19.207 with SMTP id 198mr12423349wmt.70.1487660769075; Mon, 20 Feb 2017 23:06:09 -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 q80si15273952wmg.80.2017.02.20.23.06.08; Mon, 20 Feb 2017 23:06:09 -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; 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 44E3A6882C1; Tue, 21 Feb 2017 09:05:58 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 0EF03680C81 for ; Tue, 21 Feb 2017 09:05:52 +0200 (EET) Received: by mail-wr0-f194.google.com with SMTP id q39so14137137wrb.2 for ; Mon, 20 Feb 2017 23:06:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=gH5ZZaUGyfRDglgayGapn3Go6CWkJGJ1XZc1x+AcV+Y=; b=XDn0nbuPAmPByXpPsHMizRsGtfK+KrrsiL5wuRSSejF1C0Gq6RJabo7QAVfM9cRs3G /B7yM9Ius7OPFo9x1bSKN+de2gGRXGFeVpb0jh7hwST/98xn70/4peaIXUIBncDqIbmX G03GX6nckLKi5jvs0I0oI04MUO1rx6+nEoksdRj0jnrD1brsMaY04CE+w9FmaUSJmOqD JcV87cyn4U7RRzkTH/gENaulM2dqs/QiW1SScGyScCs0hJE4afB7OGUp6iIL5AvWjGeN c+JUtljeP/0HZjk2+Onjfh9kvHkgW6gZAyk6RQ0Ukdwd3P/uzL5xHkYS1QYKUhG82xDS R5iA== 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=gH5ZZaUGyfRDglgayGapn3Go6CWkJGJ1XZc1x+AcV+Y=; b=pHW03ycK8Gg23u8FXX20FVYnFxXG7CgJc/HJc4eInBKsfa2QIrGal/SoSK75ko43BF f6mZc3ZfFeXhKodFOB9DauRG9oxfD5ESePtkDiHmGsgSOTUYaUGjSUthdgyyfyIvBUpF UAJRBnb1XOsm5I6/UTsepLeTMZnU6DsNyX7po//v5NNvR6npxaUn+0PuOm0aYrbkqCnV 465n73NTQ1oijQLherd8P32YGCv3X7itWlt1YBcaWOKSAGxaT94WErYHrtjDfhUjWxuH J2KmN5cIkcbACpENnM5wzN8stk4tu+zmjmmK4nmZiuORPohSn4WWxWkSI6zcW3ldXKpA U4ow== X-Gm-Message-State: AMke39nRmeb7WuO1bPiBxI2aUD8KwBJh7Ch+9aeim8u8edC9GhsqxK3JaNKVDTsEptmCYQ== X-Received: by 10.223.151.138 with SMTP id s10mr17790232wrb.65.1487660325988; Mon, 20 Feb 2017 22:58:45 -0800 (PST) Received: from moonbase.lan (host86-136-238-40.range86-136.btcentralplus.com. [86.136.238.40]) by smtp.gmail.com with ESMTPSA id h3sm27668269wrb.31.2017.02.20.22.58.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 20 Feb 2017 22:58:45 -0800 (PST) From: Rostislav Pehlivanov To: ffmpeg-devel@ffmpeg.org Date: Tue, 21 Feb 2017 06:58:43 +0000 Message-Id: <20170221065843.56781-1-atomnuker@gmail.com> X-Mailer: git-send-email 2.12.0.rc1.440.g5b76565f74 Subject: [FFmpeg-devel] [PATCH] lavfi/buffersrc: fix directly setting 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: Rostislav Pehlivanov MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" When setting the channel layout directly using AVBufferSrcParameters the channel layout was correctly set however the init function still expected the old string format to set the number of channels (when it hadn't already been specified). Signed-off-by: Rostislav Pehlivanov --- libavfilter/buffersrc.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c index 77fd174219..37d1992b50 100644 --- a/libavfilter/buffersrc.c +++ b/libavfilter/buffersrc.c @@ -341,14 +341,16 @@ static av_cold int init_audio(AVFilterContext *ctx) return AVERROR(EINVAL); } - if (s->channel_layout_str) { + if (s->channel_layout_str || s->channel_layout) { int n; - s->channel_layout = av_get_channel_layout(s->channel_layout_str); - if (!s->channel_layout) { - av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n", - s->channel_layout_str); - return AVERROR(EINVAL); + if (s->channel_layout_str) { + s->channel_layout = av_get_channel_layout(s->channel_layout_str); + if (!s->channel_layout) { + av_log(ctx, AV_LOG_ERROR, "Invalid channel layout %s.\n", + s->channel_layout_str); + return AVERROR(EINVAL); + } } n = av_get_channel_layout_nb_channels(s->channel_layout); if (s->channels) {