[FFmpeg-devel] [PATCH 2/5] avutil/channel_layout: add AV_CHANNEL_ORDER_NB

James Almer jamrial at gmail.com
Tue Feb 13 19:25:35 EET 2024


On 2/12/2024 6:15 PM, Marton Balint wrote:
> Signed-off-by: Marton Balint <cus at passwd.hu>
> ---
>   libavutil/channel_layout.h | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h
> index b8bff6f365..db0c005e87 100644
> --- a/libavutil/channel_layout.h
> +++ b/libavutil/channel_layout.h
> @@ -146,6 +146,10 @@ enum AVChannelOrder {
>        * as defined in AmbiX format $ 2.1.
>        */
>       AV_CHANNEL_ORDER_AMBISONIC,
> +    /**
> +     * Number of channel orders, not part of ABI/API
> +     */
> +    AV_CHANNEL_ORDER_NB
>   };

Is it worth adding this to a public header just to limit a loop in a 
test? A loop that fwiw still depends on an array that needs to be 
updated with more names if you add new orders.

IMO, just do FF_ARRAY_ELEMS(channel_order_names) in the test.


More information about the ffmpeg-devel mailing list