[FFmpeg-cvslog] avutil/tests/channel_layout: test av_channel_layout_check()

James Almer git at videolan.org
Fri Mar 25 17:27:23 EET 2022


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Fri Mar 25 11:36:20 2022 -0300| [cbeb827cfbda590ee8c81572d1c11c4841e77fd9] | committer: James Almer

avutil/tests/channel_layout: test av_channel_layout_check()

Should increase test coverage

Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavutil/tests/channel_layout.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/tests/channel_layout.c b/libavutil/tests/channel_layout.c
index eb9cf1b950..34f1197bfd 100644
--- a/libavutil/tests/channel_layout.c
+++ b/libavutil/tests/channel_layout.c
@@ -31,7 +31,8 @@
 #define CHANNEL_LAYOUT_FROM_MASK(x)                                        \
     av_channel_layout_uninit(&layout);                                     \
     av_bprint_clear(&bp);                                                  \
-    if (!av_channel_layout_from_mask(&layout, x))                          \
+    if (!av_channel_layout_from_mask(&layout, x) &&                        \
+         av_channel_layout_check(&layout))                                 \
         av_channel_layout_describe_bprint(&layout, &bp);                   \
     else                                                                   \
         av_bprintf(&bp, "fail");
@@ -39,7 +40,8 @@
 #define CHANNEL_LAYOUT_FROM_STRING(x)                                      \
     av_channel_layout_uninit(&layout);                                     \
     av_bprint_clear(&bp);                                                  \
-    if (!av_channel_layout_from_string(&layout, x))                        \
+    if (!av_channel_layout_from_string(&layout, x) &&                      \
+         av_channel_layout_check(&layout))                                 \
         av_channel_layout_describe_bprint(&layout, &bp);                   \
     else                                                                   \
         av_bprintf(&bp, "fail");



More information about the ffmpeg-cvslog mailing list