[FFmpeg-devel] [PATCH 001/279] Add a new channel layout API

Marton Balint cus at passwd.hu
Wed Dec 15 10:52:59 EET 2021



On Tue, 14 Dec 2021, James Almer wrote:

>> 
>>> 
>>>>
>>>>>       return channel_names[channel_id].name;
>>>>>   }
>>>>>
>>>>>   -static const struct {
>>>>>   +static inline void get_channel_str(AVBPrint *bp, const char *str,
>>>>>   +                                   enum AVChannel channel_id)
>>>>>   +{
>>>>>   +    if (str)
>>>>>   +        av_bprintf(bp, "%s", str);
>>>>>   +    else
>>>>>   +        av_bprintf(bp, "?");
>>>>
>>>>   If this is not allowed, then you should propagate back AVERROR(EINVAL)
>>>>  if
>>>>   it does. If it is allowed, because the user can use some custom
>>>>   channel_id-s, then something like "USER%d" should be returned IMHO.
>>>
>>>  How about Ch%d? It would also further improve the usefulness of
>>>  av_channel_layout_from_string() by looking for such strings.
>>
>>  I find "Ch%d" a bit confusing, beacuse "Ch%d" would normally mean the n-th
>>  channel in a layout, not a channel with the n-th ID.
>
> What do you suggest? USER%d is IMO ugly. Maybe ChID%d? Although both are a 
> bit long.

Can be Usr%d, Dsg%d if you like these better. If not then, I don't mind 
too much Ch%d, I just find it a bit confusing.

Regards,
Marton


More information about the ffmpeg-devel mailing list