From: Marton Balint <cus@passwd.hu>
To: ffmpeg-devel@ffmpeg.org
Cc: Marton Balint <cus@passwd.hu>
Subject: [FFmpeg-devel] [PATCH v2 1/4] avutil/channel_layout: print channels using av_channel_name_bprint in av_channel_layout_describe_bprint
Date: Tue, 15 Mar 2022 22:18:55 +0100
Message-ID: <20220315211858.26800-1-cus@passwd.hu> (raw)
In-Reply-To: <1382f5bd-673f-f429-0ce9-ce39c3f9b586@gmail.com>
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 <cus@passwd.hu>
---
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);
--
2.31.1
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2022-03-15 21:19 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-15 20:30 [FFmpeg-devel] [PATCH " Marton Balint
2022-03-15 20:30 ` [FFmpeg-devel] [PATCH 2/4] avutil/channel_layout: factorize ambisonic order detection Marton Balint
2022-03-15 20:49 ` James Almer
2022-03-15 20:30 ` [FFmpeg-devel] [PATCH 3/4] avutil/channel_layout: do not copy alloc new map for extra channel layout Marton Balint
2022-03-15 20:39 ` James Almer
2022-03-15 20:30 ` [FFmpeg-devel] [PATCH 4/4] avutil/channel_layout: fix av_channel_layout_describe_bprint with custom and ambisonic channels Marton Balint
2022-03-15 20:42 ` James Almer
2022-03-15 20:44 ` [FFmpeg-devel] [PATCH 1/4] avutil/channel_layout: print channels using av_channel_name_bprint in av_channel_layout_describe_bprint James Almer
2022-03-15 21:18 ` Marton Balint [this message]
2022-03-15 21:18 ` [FFmpeg-devel] [PATCH v2 2/4] avutil/channel_layout: factorize ambisonic order detection Marton Balint
2022-03-15 21:24 ` James Almer
2022-03-15 21:31 ` Marton Balint
2022-03-15 21:18 ` [FFmpeg-devel] [PATCH v2 3/4] avutil/channel_layout: do not copy alloc new map for extra channel layout Marton Balint
2022-03-15 21:26 ` James Almer
2022-03-15 22:28 ` Marton Balint
2022-03-15 21:18 ` [FFmpeg-devel] [PATCH v2 4/4] avutil/channel_layout: fix av_channel_layout_describe_bprint with custom and ambisonic channels Marton Balint
2022-03-15 21:28 ` James Almer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220315211858.26800-1-cus@passwd.hu \
--to=cus@passwd.hu \
--cc=ffmpeg-devel@ffmpeg.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
This inbox may be cloned and mirrored by anyone:
git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
ffmpegdev@gitmailbox.com
public-inbox-index ffmpegdev
Example config snippet for mirrors.
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git