Message ID | 20220921214202.1300-1-jamrial@gmail.com |
---|---|
State | Accepted |
Commit | 05cff214b9234c0e24ffe73b0bb929787267c7e2 |
Headers | show |
Series | [FFmpeg-devel] avutil/channel_layout: mention how the API user should treat channel orders it does not understand | expand |
Context | Check | Description |
---|---|---|
yinshiyou/make_loongarch64 | success | Make finished |
yinshiyou/make_fate_loongarch64 | success | Make fate finished |
andriy/make_x86 | success | Make finished |
andriy/make_fate_x86 | success | Make fate finished |
Quoting James Almer (2022-09-21 23:42:02) > In case new orders are added in the future, existing library users can still > use the layout simply by ignoring everything but the channel count in it, so > make this explicit. sure
diff --git a/libavutil/channel_layout.h b/libavutil/channel_layout.h index 4dd6614de9..9e685fab72 100644 --- a/libavutil/channel_layout.h +++ b/libavutil/channel_layout.h @@ -290,6 +290,9 @@ typedef struct AVChannelCustom { typedef struct AVChannelLayout { /** * Channel order used in this layout. + * Any value not defined in the AVChannelOrder enum in a layout that + * av_channel_layout_check() doesn't reject must be treated as if it was + * AV_CHANNEL_ORDER_UNSPEC. * This is a mandatory field. */ enum AVChannelOrder order;
In case new orders are added in the future, existing library users can still use the layout simply by ignoring everything but the channel count in it, so make this explicit. Signed-off-by: James Almer <jamrial@gmail.com> --- libavutil/channel_layout.h | 3 +++ 1 file changed, 3 insertions(+)