From patchwork Tue Mar 19 21:14:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 47233 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8ba5:b0:1a3:31a3:7958 with SMTP id m37csp12641pzh; Tue, 19 Mar 2024 14:15:21 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVJf4zHQYwpHknS2OcfDSFtlKcP2/2I7emQ5dSvcuL93BG20uNAUaaQvg81LCY3ikYDtEBnHHmc3leXspZR/XBCnvK4k+rgSnymOw== X-Google-Smtp-Source: AGHT+IEMlNH8vUntdBmNh2JWknNz/Ei5LNpb2c2AqK/G77sGg9nUikQSp8ZlkB1uE9Xxpn4IaD+x X-Received: by 2002:a17:906:7807:b0:a46:e017:1ef7 with SMTP id u7-20020a170906780700b00a46e0171ef7mr39895ejm.64.1710882920876; Tue, 19 Mar 2024 14:15:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710882920; cv=none; d=google.com; s=arc-20160816; b=Le8eCO6w2YIrLw4qDvtVVV46IMBcLlqmbtNNqpfBJHPjC2MfbTiC6Q2xjgPQWTJ0I+ H4TtaZ4vjrWuWlvq7sxi3VUj8tOwX+w1tUqplbD+K4MDCVu6HyKYRuSiOXw6voKNqw3d IXsTVTTa3VpcYaLHepDDoEwsGsSxE3aEUJ6+qY3vbmzuDKi4O7sqvi75TX8MJUsoT4Dy Q1+SfJiQjoJ7wS5xYrvE1J3nj7+uVsA4orOVJtsR/tlDhVm1z+Be5NjfBSpp7paQSfP+ dZ8ooXLXRj+JUaCbr6dBUsmKBMnH3jHugSSGi9mhzxlRMbltraecrm6vQbLyJi7e/zXh 2mOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=HQA91Ied9hkTgso6ooCKZC6p4YTVXZT8qClNQOHR6eQ=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=PuXNnH9kOjOGxdcVP7y4X3uz6n3YSaPtT7Cb3mJi5veRRjP2wvjquZ+Sn4q85OYlRY ztThTSlRpNCPXK9ZDhdWN5gW2v60KE5d7NFdF2O7WsYvr9KZbNIGPyn66H/Z4l8tgKV1 UxV/ihfeXgVCPsTroQe0fDhtfEL5I/IoJo2y0+O/UMYB+H8TmveXaxGGdsydoISJ16jY 1gMoFSQilUHGUn92YdWHGzDC60U/Jhp+jMPvF33KRyrAZ2m53sQAvpK86gTvBcyBVHx4 SXSWbOGMicVDygofdHd3uOjc13MXSnqgC4G4rx7t7lsj0Zf4YF4mcmitVMaXL1VYPkFb ICaQ==; dara=google.com ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id dk5-20020a170906f0c500b00a46605d6943si5779266ejb.934.2024.03.19.14.15.20; Tue, 19 Mar 2024 14:15:20 -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 4965A68D434; Tue, 19 Mar 2024 23:15: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 CE98068C308 for ; Tue, 19 Mar 2024 23:15:11 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A81EFEA1B2; Tue, 19 Mar 2024 22:15:11 +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 kW0GP4Q4Ih9Z; Tue, 19 Mar 2024 22:15:08 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id A0C32E9BD0; Tue, 19 Mar 2024 22:15:08 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 22:14:59 +0100 Message-Id: <20240319211504.8342-1-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/6] avfilter/af_channelmap: fix error message if FL source channel was missing X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: neAE15PFGGE4 FL channel ID is 0, so for an unset value we must check for ID < 0. Regression since 1f96db959c1235bb7079d354e09914a0a2608f62. Signed-off-by: Marton Balint --- libavfilter/af_channelmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 5e1cf57680..d13dcc317d 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -165,7 +165,7 @@ static av_cold int channelmap_init(AVFilterContext *ctx) for (i = 0; i < map_entries; i++) { int in_ch_idx = -1, out_ch_idx = -1; - int in_ch = 0, out_ch = 0; + int in_ch = -1, out_ch = -1; static const char err[] = "Failed to parse channel map\n"; switch (mode) { case MAP_ONE_INT: @@ -349,7 +349,7 @@ static int channelmap_config_input(AVFilterLink *inlink) if (m->in_channel_idx < 0 || m->in_channel_idx >= nb_channels) { av_channel_layout_describe(&inlink->ch_layout, layout_name, sizeof(layout_name)); - if (m->in_channel) { + if (m->in_channel >= 0) { av_channel_name(channel_name, sizeof(channel_name), m->in_channel); av_log(ctx, AV_LOG_ERROR, "input channel '%s' not available from input layout '%s'\n",