mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
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@passwd.hu>
This commit is contained in:
parent
bf5099b12b
commit
bd40375dd2
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user