From patchwork Tue Mar 15 20:30:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marton Balint X-Patchwork-Id: 34780 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6838:3486:0:0:0:0 with SMTP id ek6csp3327869nkb; Tue, 15 Mar 2022 13:30:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzuNbv/Qf1SlSRvoEq8lGxsQ7aw3NgM0WnEhuDAHVz2saXEr4UcuWSUiVgYfaXvRs1TNUkY X-Received: by 2002:a17:906:5011:b0:6cf:82ff:f1bf with SMTP id s17-20020a170906501100b006cf82fff1bfmr24309715ejj.69.1647376232732; Tue, 15 Mar 2022 13:30:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647376232; cv=none; d=google.com; s=arc-20160816; b=bOd4Xf8h76s2W05hicDfLcqdJ+y2EMc9w9K1QZqTgxYXmiGNf84JBTVH5HMYt5+TR2 6kWarA8p71Eit3aMwRxLVLBHfXtjLPIzkQLgxZpUWq/ZNLGE3ifocHEBS+VA0bu840ZL VWFplVsNjCHffuQ/+pmlCiDsf6H9EbFhn5b+ShZA3tk9Sb91BWEg09AWuP482+ogl62O 905nmcIIn9f+tJ2JOv6OCZ+5+DGUHf0KgfXa9kNN7dRcBlRDqXJYy+/4/vIEi1RhLo0Z WtQlebvz2oPglUwo5OiQmNe67JkM/Gsx3CQ05oEdGo2zVDjok2z+ZKc4mTHJmKHkEfn5 8xmg== 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=vvst9EgM6Y2HmZVBuRJELN2DVBIaqbYXvyTV18RBAz8=; b=H4i0GRcsQFMHSAIAuUispuvOuMjaiPMT2rkc5vd16VD+eWH9XQ7DwXurJ9ZzKL5xho ppAwnPFWTBuwFt//NF2nMEcoC9S8fipQP+43+zPBLx1EIiI1tA/Z3lXN3P2MrH5bSO99 4CTsLvyt6iMLLIsrkWEFBNd2fCF0HIOVPwNyrp9RRTmsU9QME/xlhMeVsNJpppABQMqk l1nyuVkh57iblfMt7GyeVEjls0Aj7w+bNibCYZ8Ve5/Wx1p2CgzsRvHYxGrzgwrZvG9b JWvYQ8ZUO98Y6ShNhuPHH13L43UeV5U4/pYWHxnGcoqTZCsUxFins6EAcBsFSRRraqUd tu4g== 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 n19-20020a17090625d300b006d16268ca7dsi10837578ejb.804.2022.03.15.13.30.32; Tue, 15 Mar 2022 13:30:32 -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 8BE1968B0BE; Tue, 15 Mar 2022 22:30: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 8EC7268A441 for ; Tue, 15 Mar 2022 22:30:22 +0200 (EET) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id B693CE5B6A; Tue, 15 Mar 2022 21:30: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 bHnCHZp62DzN; Tue, 15 Mar 2022 21:30:19 +0100 (CET) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 8DD01E134B; Tue, 15 Mar 2022 21:30:19 +0100 (CET) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 15 Mar 2022 21:30:10 +0100 Message-Id: <20220315203013.14304-1-cus@passwd.hu> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/4] avutil/channel_layout: print channels using av_channel_name_bprint in av_channel_layout_describe_bprint 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: uS/7v9gvN+t6 This reduces code duplication an allows printing AMBI%d channel names for custom layouts for non-standard or partial ambisonic layouts. Signed-off-by: Marton Balint --- libavutil/channel_layout.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libavutil/channel_layout.c b/libavutil/channel_layout.c index 8cc4efe4cf..c60ccf368f 100644 --- a/libavutil/channel_layout.c +++ b/libavutil/channel_layout.c @@ -737,14 +737,10 @@ int av_channel_layout_describe_bprint(const AVChannelLayout *channel_layout, av_bprintf(bp, "%d channels (", channel_layout->nb_channels); for (i = 0; i < channel_layout->nb_channels; i++) { enum AVChannel ch = av_channel_layout_channel_from_index(channel_layout, i); - const char *channel = get_channel_name(ch); if (i) av_bprintf(bp, "+"); - if (channel) - av_bprintf(bp, "%s", channel); - else - av_bprintf(bp, "USR%d", ch); + av_channel_name_bprint(bp, ch); if (channel_layout->order == AV_CHANNEL_ORDER_CUSTOM && channel_layout->u.map[i].name[0]) av_bprintf(bp, "@%s", channel_layout->u.map[i].name);