[FFmpeg-cvslog] avutil/channel_layout: print channels using av_channel_name_bprint in av_channel_layout_describe_bprint

Marton Balint git at videolan.org
Wed Mar 16 00:28:35 EET 2022


ffmpeg | branch: master | Marton Balint <cus at passwd.hu> | Tue Mar 15 20:43:50 2022 +0100| [bd40375dd2573aa5ed08294957b6d2864b4dd250] | committer: Marton Balint

avutil/channel_layout: print channels using av_channel_name_bprint in av_channel_layout_describe_bprint

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 at passwd.hu>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=bd40375dd2573aa5ed08294957b6d2864b4dd250
---

 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);



More information about the ffmpeg-cvslog mailing list