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", From patchwork Tue Mar 19 21:15:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 47232 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8ba5:b0:1a3:31a3:7958 with SMTP id m37csp12711pzh; Tue, 19 Mar 2024 14:15:30 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWBaN50aaIXxssQHIV/JBqhSZ0EhtgsHlgkdXzEm8hrgX4vTbF1+dQY30IhPmHWyxdPfLI5WaRQ9+hqAwyykmT3VHzqo7803SenbA== X-Google-Smtp-Source: AGHT+IHaCl7xXpTzwe4p9cG8CS7XCThDTvJM32Z9Ox99dlzNB4Uu/u1ZyQ6YJmrjrCaWqnbBETC4 X-Received: by 2002:a17:906:5448:b0:a46:b3e4:8488 with SMTP id d8-20020a170906544800b00a46b3e48488mr2599238ejp.64.1710882930351; Tue, 19 Mar 2024 14:15:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710882930; cv=none; d=google.com; s=arc-20160816; b=vz701d7kxhqXXRsW8b0N10ymQWHnKHMHS+QI0KrYx8n4bnev/Yp3T51YcWPog6l4h/ ejkjbOlN3qoBjKNeed+MohwHZvRLU8uKjk+4NaI1kq+7I7n/YSeUZ5LKpA5DtDBi2BfJ XfnHHDPi5QN/aMI+L3hJjyiFlc5YnMbuUpiFgnyzqeVtM7UFoBbkzqrokrG7FadbQ6z8 PZinlDjOXyTh7Qa/8Y+WCFgSJMOCIY3xVUp1CaEQO/OgcqZ32kGEuK+7hfUoPvyd+kRB Q1Or6kSMCG8ZSVmcfa3rV2LWl9L1QdT4naIuWnZoVzXTTqY1gkubYcgjB7GgoK0m1vBr 8fDg== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=hH4pvYCky6/70InioooLMsusph6n4nDBoMf2JI+zgY4=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=Ctb2QkgUFVzV2nNwWD46GDLTqGwg62mxnrcBzNyH6u/y/Pri8xSrOtV6ILAfCoFmf8 Rz7OqcwPrBuv6ghiUTbJzaF4Rt5in2ZFh5oljEm23nDbV0xy8d+DO8MBwwGr4hYyoK2+ c75c1uq6z5cPpafzDCtbOSmjolSJmlCMncEICwQkLov6oDtsoDYMgp5RrFNqAHhFHfBv VcF1OpLdUAMQ8+C+y/bVMIm17xK92akSQWDaepdpl/Q3UtAdjBYEj7Wj++R2iRTnXHm7 11czARTX3PC2JAVDffC3aVMVYRm7RzGldgcIf9yGkOty2O9hD00IAoqlxt1PFnriYrfd vLfw==; 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 x14-20020a1709065ace00b00a46adcbf6d2si3308621ejs.438.2024.03.19.14.15.29; Tue, 19 Mar 2024 14:15:30 -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 6D75868D437; Tue, 19 Mar 2024 23:15:22 +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 79FD168D435 for ; Tue, 19 Mar 2024 23:15:13 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 5619CEA211; Tue, 19 Mar 2024 22:15:13 +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 z_HJRaiZjZnA; Tue, 19 Mar 2024 22:15:12 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id C0AA1E9BD0; Tue, 19 Mar 2024 22:15:11 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 22:15:00 +0100 Message-Id: <20240319211504.8342-2-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240319211504.8342-1-cus@passwd.hu> References: <20240319211504.8342-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 2/6] avfilter/af_channelmap: fix mapping if in_channel was a string but out_channel was not specified 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: w0eITsAuIaBj In this case in_channel_idx was never set and the default 0 was used. Suprisingly no one noticed that the respective fate test output was wrong. Signed-off-by: Marton Balint --- libavfilter/af_channelmap.c | 2 +- tests/fate/filter-audio.mak | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index d13dcc317d..35dc4c4618 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -342,7 +342,7 @@ static int channelmap_config_input(AVFilterLink *inlink) for (i = 0; i < s->nch; i++) { struct ChannelMap *m = &s->map[i]; - if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR) { + if (s->mode == MAP_PAIR_STR_INT || s->mode == MAP_PAIR_STR_STR || s->mode == MAP_ONE_STR) { m->in_channel_idx = av_channel_layout_index_from_channel( &inlink->ch_layout, m->in_channel); } diff --git a/tests/fate/filter-audio.mak b/tests/fate/filter-audio.mak index 308969c4ac..88299a932f 100644 --- a/tests/fate/filter-audio.mak +++ b/tests/fate/filter-audio.mak @@ -302,7 +302,7 @@ fate-filter-channelmap-one-str: SRC = $(TARGET_PATH)/tests/data/asynth-44100-2.w fate-filter-channelmap-one-str: tests/data/asynth-44100-2.wav fate-filter-channelmap-one-str: CMD = md5 -auto_conversion_filters -i $(SRC) -/filter_complex $(TARGET_PATH)/tests/data/filtergraphs/channelmap_one_str -f wav -fflags +bitexact fate-filter-channelmap-one-str: CMP = oneline -fate-filter-channelmap-one-str: REF = 0ea3052e482c95d5d3bd9da6dac1b5fa +fate-filter-channelmap-one-str: REF = e18791f65ce5861e130b2c3e472ab90a FATE_AFILTER-$(call FILTERDEMDECENCMUX, CHANNELMAP ARESAMPLE, WAV, PCM_S16LE, PCM_S16LE, WAV) += $(FATE_FILTER_CHANNELMAP) From patchwork Tue Mar 19 21:15:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 47234 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8ba5:b0:1a3:31a3:7958 with SMTP id m37csp12786pzh; Tue, 19 Mar 2024 14:15:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWjONsl9VgL3g5E6obq8+xeAL43rZvJuP2qkMNTUQITO54mAM0BrRMaYyYTpJx5PEOR7x7OoVk0YyB8XsmeIq//ZxD6j41qIbceLw== X-Google-Smtp-Source: AGHT+IFkHFH+YDPDzI/7hVOt1QyrMLZD+pfeJ2wNH1fHg1cukJxMCB6jJPM/zaHE1Apu9dO3+WJz X-Received: by 2002:a17:906:3299:b0:a46:b028:7de0 with SMTP id 25-20020a170906329900b00a46b0287de0mr50632ejw.49.1710882939464; Tue, 19 Mar 2024 14:15:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710882939; cv=none; d=google.com; s=arc-20160816; b=ZFDJFdYoCPxih4YgRm3QsW/Z5HEz1E23csapQc7TNpZsluGC23nkTHTeNFSyXKhX3q azBhmDAgnsHimiH0esowOG60AGrmSqZE8BjTkVBbuDmSEPnoqNPwHqWANsfVwY2mGBtD zV1AQHp3uzNP8fT8MRkFxlyThAANBCILdXqgJTfLCJ5HxmYRs3w7a4a21eeojB8zyY3Z H59QFQS00zkjqd3e/ehGYXHSW2fvfHy2F7TNYtjrPNkJpG+AkzmV9gB754K8o2ruZi5+ wG082+GmSY4rDkqNCpt6zgQHGGEw81lUpph6qUOTmFUJlqSOxbF4z2NnWJEcnMNH3aXK FSpQ== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=dacM+wwAkynaE+SCDvuGkw7CP/Z7kmMCPmbUzlLN1m8=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=fiuouFN1dNxn9J9wVanc1XMY67o3Di+p/ViAtjj0lOAIBBS33bwgW0T3f44P+LCrGd S2HhJp0PE8wgsne+r15ynt0KPfyaf0QLRDvIyoi6J+IlvqWo1ZrRpKzsXyWsWmeUV5qf j6TFPXjt1g2IDgAPC37Xd++uGZegr6DHBjVcC991k48GDF+50QjpTZzdQUart9LXHBvu lZmoGVW2AKKuEJ2hxmWICVu5CRg2iC4lIyjJE+2H/mhYvRS2NwlzjRBgTL8ATPkH63um BeGqY1ZeSHzkJzqgDpmaWlyL3YfOf/O6QwcoiGUpDHqVcjmf683GsBG+AyUGbaXFAm5q YItg==; 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 lg20-20020a170906f89400b00a3e4e20ecdcsi5618352ejb.13.2024.03.19.14.15.39; Tue, 19 Mar 2024 14:15:39 -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 6670A68D442; Tue, 19 Mar 2024 23:15:23 +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 5A6DF68D430 for ; Tue, 19 Mar 2024 23:15:16 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 15429EA1C9; Tue, 19 Mar 2024 22:15:16 +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 jmHf7Z9u9qxj; Tue, 19 Mar 2024 22:15:13 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 8B03AEA225; Tue, 19 Mar 2024 22:15:13 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 22:15:01 +0100 Message-Id: <20240319211504.8342-3-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240319211504.8342-1-cus@passwd.hu> References: <20240319211504.8342-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 3/6] avfilter/af_channelmap: disallow channel index 64 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: XVAs3KmqYPQb MAX_CH is 64, therefore the maximum index is 63. 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 35dc4c4618..1ecbddd462 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -84,7 +84,7 @@ static char* split(char *message, char delim) { return next; } -static int get_channel_idx(char **map, int *ch, char delim, int max_ch) +static int get_channel_idx(char **map, int *ch, char delim, int max_nb_channels) { char *next; int len; @@ -98,7 +98,7 @@ static int get_channel_idx(char **map, int *ch, char delim, int max_ch) sscanf(*map, "%d%n", ch, &n); if (n != len) return AVERROR(EINVAL); - if (*ch < 0 || *ch > max_ch) + if (*ch < 0 || *ch >= max_nb_channels) return AVERROR(EINVAL); *map = next; return 0; From patchwork Tue Mar 19 21:15:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 47235 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8ba5:b0:1a3:31a3:7958 with SMTP id m37csp12889pzh; Tue, 19 Mar 2024 14:15:48 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWpgtFpSvnjweJfYDUEM3LktewU5lXK7r8VzWRVbXZvweKx7A+KFCduSvoYBib/lDVtk4xK8B+kob1kgu/DZXJlzSPnlmRd5gWjDA== X-Google-Smtp-Source: AGHT+IH7tMBrqnDe/onIVZNAllgYFHR3FZ8GxulxbgCe/91Qcq97Tucu/uqfVWEyBEBT0MzbJXhC X-Received: by 2002:a19:434c:0:b0:513:bc95:50c3 with SMTP id m12-20020a19434c000000b00513bc9550c3mr202571lfj.12.1710882948297; Tue, 19 Mar 2024 14:15:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710882948; cv=none; d=google.com; s=arc-20160816; b=ENvdf+1JKTF6YrrfSTpCPoI+tpe7VaGF29a55eEE34x8/XSKR/ERr0p7NLQLvUZgnB IZsdOCPvUejVyPp7OgToG14m+M9YRp7iq+8nfP3OhqsY13NiAOwmHFL7dszME0Zm+6Hd Xj3/vU5F+i3W66iEsaSG3jcTYS1+HvQKLuROr0yw4lJdYE8qb5FjkMJYaBizbgg6/vU0 Kpi4RN1LQytgiYit8iX+t4aiQc186DLiToft4QP70s4cIfXVCagMoHenrksG4jgegM3L YcSFu5pebmDL4qF+xnE1SDaeQmWQbgX3nbK08UiK9Y3vxDrtjqvsRr0HsLJXzdWxjC3T +4ng== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=ejJDrVqYiZnelQkAVB60mtQ9mzTjNfXDRikIj/bXg1s=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=HTV1U4ll3wQvPuIOScdgOeeImLMnQcVOinzXMIJGiaN9JquPEtozjF2R6W6IChxk0L pD/P9UuH7caDTEjnUPphGRPmFvmdMRyyYV15ony/09kfnQDpIo5/zNWSvw7COlT5yGab JSC8UmG+woYI/P1ai3pDfCZV1VYj/C5V1/dy4GAkwtXGjKfFalvK6CADbKtO607B0W5x hGPPjOQBFdZB8FR8KFWDErOHyc2Y+FX72SJr1+MXOsI3EJ2+CVc0ytODN4c0aqj4+Hgs muhD4KZleXVG5780cROl/Sq35hm6cAU3MiTPNGht0TkowX7wNmGMd92WGRfQUNoYHPIu s8TA==; 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 z7-20020a17090655c700b00a4666bb4878si5581962ejp.601.2024.03.19.14.15.47; Tue, 19 Mar 2024 14:15:48 -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 74E3B68D449; Tue, 19 Mar 2024 23:15:25 +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 3988C68D442 for ; Tue, 19 Mar 2024 23:15:18 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 198AEE9BD0; Tue, 19 Mar 2024 22:15:18 +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 7EzMndVLEG1A; Tue, 19 Mar 2024 22:15:16 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 462E8EA242; Tue, 19 Mar 2024 22:15:16 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 22:15:02 +0100 Message-Id: <20240319211504.8342-4-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240319211504.8342-1-cus@passwd.hu> References: <20240319211504.8342-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 4/6] avfilter/af_channelmap: factorize checking indexes against a channel layout 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: VHKWh8LVsxRW Signed-off-by: Marton Balint --- libavfilter/af_channelmap.c | 41 ++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 16 deletions(-) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 1ecbddd462..62e11103ad 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -116,6 +116,30 @@ static int get_channel(char **map, int *ch, char delim) return 0; } +static int check_idx_and_id(AVFilterContext *ctx, int channel_idx, int channel, AVChannelLayout *ch_layout, const char *io) +{ + char channel_name[64]; + char layout_name[256]; + int nb_channels = ch_layout->nb_channels; + + if (channel_idx < 0 || channel_idx >= nb_channels) { + av_channel_layout_describe(ch_layout, layout_name, sizeof(layout_name)); + if (channel >= 0) { + av_channel_name(channel_name, sizeof(channel_name), channel); + av_log(ctx, AV_LOG_ERROR, + "%sput channel '%s' not available from %sput layout '%s'\n", + io, channel_name, io, layout_name); + } else { + av_log(ctx, AV_LOG_ERROR, + "%sput channel #%d not available from %sput layout '%s'\n", + io, channel_idx, io, layout_name); + } + return AVERROR(EINVAL); + } + + return 0; +} + static av_cold int channelmap_init(AVFilterContext *ctx) { ChannelMapContext *s = ctx->priv; @@ -334,10 +358,7 @@ static int channelmap_config_input(AVFilterLink *inlink) { AVFilterContext *ctx = inlink->dst; ChannelMapContext *s = ctx->priv; - int nb_channels = inlink->ch_layout.nb_channels; int i, err = 0; - char channel_name[64]; - char layout_name[256]; for (i = 0; i < s->nch; i++) { struct ChannelMap *m = &s->map[i]; @@ -347,20 +368,8 @@ static int channelmap_config_input(AVFilterLink *inlink) &inlink->ch_layout, m->in_channel); } - 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 >= 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", - channel_name, layout_name); - } else { - av_log(ctx, AV_LOG_ERROR, - "input channel #%d not available from input layout '%s'\n", - m->in_channel_idx, layout_name); - } + if (check_idx_and_id(ctx, m->in_channel_idx, m->in_channel, &inlink->ch_layout, "in") < 0) err = AVERROR(EINVAL); - } } return err; From patchwork Tue Mar 19 21:15:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 47236 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8ba5:b0:1a3:31a3:7958 with SMTP id m37csp12971pzh; Tue, 19 Mar 2024 14:15:57 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCV3KfVKpr8+McjB3JmwUjuAkr5JAigsT6Zn9+du0G6XbjoykMgbAfZ9qIsBYNqoaTChBdcNQAbBBcGkMap2m8bCOmbkDV6wHLCO4w== X-Google-Smtp-Source: AGHT+IHjLOYJyuiT/qwfz4Tt8cnRKXm5fvql30XANzHUXA3GhUzkaxHkkBI0fe/c1B2nlV+B7dny X-Received: by 2002:a17:907:198e:b0:a46:7929:8850 with SMTP id li14-20020a170907198e00b00a4679298850mr13323642ejc.39.1710882956938; Tue, 19 Mar 2024 14:15:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710882956; cv=none; d=google.com; s=arc-20160816; b=AALCmWDvlJXAsE1QAtWLU2Xnovjz+34qDy2ZsAmwfFeoRmR4WXXlLAqL5jR7S7Y4uz cOm8kPX7yqc46fh0LOumdHcHrbiF3N7Pxr4jNoWQbl1gfrON/vuEf9yb3tRL3ZUgwV/L VpTgxh/fCpRPD6hddzxM8EGdQCLm5nJHJnZwGe792voCPO3KB42R+ez7Q/98LNHZQJRs QZTA2dpAlGeaeUJu54XH1QZMEj82+VvRNbwqYrDjg5CAxL4GvEwhjjRbzKXNrdS+U415 d1GV/BZE/SrTZfu0ztJbbKFXJOZuooMKzGfOCe1JbdWwZsZxgKRE4bOPZ0E1vjA4rxCS 0rpg== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=3KqghXL/DCHXV+6Pziy8qkQXxgRCdJzXzlbp7rcTGOs=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=sHXg6wTi2ffZlaYvQsm2GoUVFTFsvH+Y+tYqUaR0G3nvw0uwPiO7WHi2W6+G1hJjO7 mOzRO26dsndbW2KrBFbcLKzA4ykVUHJdg5XkqrRBznfwCwysQSHA92TNdzqBHSIJdz/V REOUyPK+Xh9H80KBZzANZY9QesX9vM4loDIcJN5KK22+ex3APVmfxpcqMRyBjDk2LMJb PKWE5dWrtfW8sCFDvwpA3tPcp7Wj4W7Z8CxOkHXJsTaN24ATcu0J7fLMT5IGLgjQ8YCn VUmmORIMNG/Z2HZrgNFGlTwLCDJ6KxpELmp6FiJCxV4Ler/gFfbI5NqcIlbSVJQZj+H0 KSOQ==; 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 k6-20020a1709062a4600b00a46cbf87138si1799533eje.958.2024.03.19.14.15.56; Tue, 19 Mar 2024 14:15:56 -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 65AA368D44A; Tue, 19 Mar 2024 23:15:28 +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 2591E68D44B for ; Tue, 19 Mar 2024 23:15:22 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 10B8CEA1C9; Tue, 19 Mar 2024 22:15:22 +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 ZYG5Rw4Cxl07; Tue, 19 Mar 2024 22:15:20 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 6BCA3EA212; Tue, 19 Mar 2024 22:15:18 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 22:15:03 +0100 Message-Id: <20240319211504.8342-5-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240319211504.8342-1-cus@passwd.hu> References: <20240319211504.8342-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 5/6] avfilter/af_channelmap: add some additional checks for the mappings 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: eZhBQPUxSsce - Properly initialize all the mappings to -1 by default. - Make sure every output channel is assigned exactly once - Autodetect a native layout when only native channels are present - Always honor the user specified layout, but make sure the mapping is compatible with it The last item is a regression from 4af412be7153405e43930ac73fc7d91d7ded19eb. Signed-off-by: Marton Balint --- libavfilter/af_channelmap.c | 53 +++++++++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 11 deletions(-) diff --git a/libavfilter/af_channelmap.c b/libavfilter/af_channelmap.c index 62e11103ad..64efacb576 100644 --- a/libavfilter/af_channelmap.c +++ b/libavfilter/af_channelmap.c @@ -146,7 +146,8 @@ static av_cold int channelmap_init(AVFilterContext *ctx) char *mapping, separator = '|'; int map_entries = 0; enum MappingMode mode; - uint64_t out_ch_mask = 0; + int64_t out_ch_mask = 0; + uint64_t presence_mask; int i; mapping = s->mapping_str; @@ -187,6 +188,13 @@ static av_cold int channelmap_init(AVFilterContext *ctx) return AVERROR(EINVAL); } + for (i = 0; i < MAX_CH; i++) { + s->map[i].in_channel_idx = -1; + s->map[i].out_channel_idx = -1; + s->map[i].in_channel = -1; + s->map[i].out_channel = -1; + } + for (i = 0; i < map_entries; i++) { int in_ch_idx = -1, out_ch_idx = -1; int in_ch = -1, out_ch = -1; @@ -219,14 +227,16 @@ static av_cold int channelmap_init(AVFilterContext *ctx) break; case MAP_PAIR_INT_STR: if (get_channel_idx(&mapping, &in_ch_idx, '-', MAX_CH) < 0 || - get_channel(&mapping, &out_ch, separator) < 0 || - (1ULL << out_ch) & out_ch_mask) { + get_channel(&mapping, &out_ch, separator) < 0) { av_log(ctx, AV_LOG_ERROR, err); return AVERROR(EINVAL); } s->map[i].in_channel_idx = in_ch_idx; s->map[i].out_channel = out_ch; - out_ch_mask |= 1ULL << out_ch; + if (out_ch < 63) + out_ch_mask |= 1ULL << out_ch; + else + out_ch_mask = -1; break; case MAP_PAIR_STR_INT: if (get_channel(&mapping, &in_ch, '-') < 0 || @@ -239,23 +249,27 @@ static av_cold int channelmap_init(AVFilterContext *ctx) break; case MAP_PAIR_STR_STR: if (get_channel(&mapping, &in_ch, '-') < 0 || - get_channel(&mapping, &out_ch, separator) < 0 || - (1ULL << out_ch) & out_ch_mask) { + get_channel(&mapping, &out_ch, separator) < 0) { av_log(ctx, AV_LOG_ERROR, err); return AVERROR(EINVAL); } s->map[i].in_channel = in_ch; s->map[i].out_channel = out_ch; - out_ch_mask |= 1ULL << out_ch; + if (out_ch < 63) + out_ch_mask |= 1ULL << out_ch; + else + out_ch_mask = -1; break; } } s->mode = mode; s->nch = map_entries; - if (out_ch_mask) - av_channel_layout_from_mask(&s->output_layout, out_ch_mask); - else if (map_entries && s->output_layout.nb_channels == 0) - av_channel_layout_default(&s->output_layout, map_entries); + if (s->output_layout.nb_channels == 0) { + if (out_ch_mask > 0) + av_channel_layout_from_mask(&s->output_layout, out_ch_mask); + else if (map_entries) + av_channel_layout_default(&s->output_layout, map_entries); + } if (mode == MAP_NONE) { int i; @@ -286,6 +300,23 @@ static av_cold int channelmap_init(AVFilterContext *ctx) } } + presence_mask = 0; + for (i = 0; i < s->nch; i++) { + uint64_t idx_mask; + int ret = check_idx_and_id(ctx, s->map[i].out_channel_idx, s->map[i].out_channel, &s->output_layout, "out"); + if (ret < 0) + return ret; + idx_mask = (1ULL << s->map[i].out_channel_idx); + if (presence_mask & idx_mask) { + char layout_name[256]; + av_channel_layout_describe(&s->output_layout, layout_name, sizeof(layout_name)); + av_log(ctx, AV_LOG_ERROR, "Mapping %d assigns channel #%d twice in output layout '%s'.\n", + i + 1, s->map[i].out_channel_idx, layout_name); + return AVERROR(EINVAL); + } + presence_mask |= idx_mask; + } + return 0; } From patchwork Tue Mar 19 21:15:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 47237 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:8ba5:b0:1a3:31a3:7958 with SMTP id m37csp13065pzh; Tue, 19 Mar 2024 14:16:06 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCVdQ7IxbR1U/wIgtjHKvz+1IGZMt1bIVFh3xF5J3bbD64Pw6rhkt4asxIoWp7x1GGd5LYeusF8hzWzmUDMGmD2kliml1sWFjPK2zw== X-Google-Smtp-Source: AGHT+IFMXRB/U5kOTG81/ILewhGWxP+0U5kZ65NpbQTKTHIu68Sz0E6+7yNiz9FOE4jB741UJOd4 X-Received: by 2002:a50:d5d6:0:b0:568:9b14:d6c7 with SMTP id g22-20020a50d5d6000000b005689b14d6c7mr3786902edj.16.1710882965835; Tue, 19 Mar 2024 14:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1710882965; cv=none; d=google.com; s=arc-20160816; b=1IemK9fz1ZsqHvTAfhR42wZFZ/G1eXMVY9szJ2tJoDA2nBKvwWQt2W6VuuYQo4hgv5 GoSoc3MB1xeLJz3weLe9GqUYsFGI7B8fcgAuF/ve9HKs81LA25PzJ4YYN8zjQ6PE/dGl P2xsLMoBKXRZkAAeH7EbX0TFy9BBSDMdVdNJDvlv3Ed0QvED4V694Rxy1Yjq9kU3Vb9u oiQyzeex76sYdIKVcUxTSpw48ZaXO4nrk7OAYZt+4h+Abphg+ilqcxCPes6CMk0dfaJp c007WBDIXtRxOZyYOK94DO3nRew4zLVaCR6e98vyvGL27XPuwNa1uvToCCekyFXLfGPI N4dA== 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:references:in-reply-to :message-id:date:to:from:delivered-to; bh=hr2vAFJbZ4G1G12pAVe9oU+VRB07Fuorr6CSLFl8unU=; fh=s+G8Ss4JbeMFkWPSp2LmIH/LXFyBlALRiww1j3FPjHY=; b=pexwLOKSWA45yMVTn3mffiawVV6zSQLWxLy+KsJk/8jT6IWe5ejjhjwW/g0tys/rIh +7y7/PQfzi3/hba8pqzKHYWzlyqVTsZN0ZqvMh2UHvWIEG67APK+gv5a58bxWF1gR1LP Iea/QgSXZ8xY5EvNRvuiGLfdMIo8rnNuR1TzuIl4DHuSao3fw7sSB/DQvXG/SLVwyoU8 JU0g6x0yoIrhU0WyKiZq9DX1vCje9jyDWKJ8DVH6g+Gu7tlXddJ0MMIDAvCFYR/bHP0I VquxRHicbPeiyVSt9IH6CQsP1/OdtARZniQtaZ4cyMZh0rid9ZXE/Q4wnNHMJfdalvf5 Or+A==; 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 n1-20020a170906118100b00a46af0e677fsi3013745eja.509.2024.03.19.14.16.05; Tue, 19 Mar 2024 14:16:05 -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 586B568D456; Tue, 19 Mar 2024 23:15:30 +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 B12F068D450 for ; Tue, 19 Mar 2024 23:15:23 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 82B39E9BD0; Tue, 19 Mar 2024 22:15: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 bFznmAl3R3lS; Tue, 19 Mar 2024 22:15:22 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 93C37EA1B2; Tue, 19 Mar 2024 22:15:20 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 19 Mar 2024 22:15:04 +0100 Message-Id: <20240319211504.8342-6-cus@passwd.hu> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240319211504.8342-1-cus@passwd.hu> References: <20240319211504.8342-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 6/6] doc/filters: extend af_channelmap documentation 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: lWx7F6UYdwB3 Signed-off-by: Marton Balint --- doc/filters.texi | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/doc/filters.texi b/doc/filters.texi index 913365671d..18f0d1c5a7 100644 --- a/doc/filters.texi +++ b/doc/filters.texi @@ -4291,14 +4291,18 @@ It accepts the following parameters: @item map Map channels from input to output. The argument is a '|'-separated list of mappings, each in the @code{@var{in_channel}-@var{out_channel}} or -@var{in_channel} form. @var{in_channel} can be either the name of the input -channel (e.g. FL for front left) or its index in the input channel layout. -@var{out_channel} is the name of the output channel or its index in the output -channel layout. If @var{out_channel} is not given then it is implicitly an -index, starting with zero and increasing by one for each mapping. +@code{@var{in_channel}} form. @var{in_channel} can be either the name of the +input channel (e.g. FL for front left) or its index in the input channel +layout. @var{out_channel} is the name of the output channel or its index in the +output channel layout. If @var{out_channel} is not given then it is implicitly +an index, starting with zero and increasing by one for each mapping. Mixing +different types of mappings is not allowed and will result in a parse error. @item channel_layout -The channel layout of the output stream. +The channel layout of the output stream. If not specified, then filter will +guess it based on the @var{out_channel} names or the number of mappings. +Guessed layouts will not necessarily contain channels in the order of the +mappings. @end table If no mapping is present, the filter will implicitly map input channels to