diff mbox series

[FFmpeg-devel,3/3] api/api-band-test: Query codec capabilities to decide admissibility

Message ID AS8P250MB07446DCCA80484331EA656028FC52@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM
State New
Headers show
Series [FFmpeg-devel,1/3] api/api-band-test: Remove write-only variable | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt June 9, 2024, 1:45 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 tests/api/api-band-test.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/tests/api/api-band-test.c b/tests/api/api-band-test.c
index e088d0854a..c3612bedb9 100644
--- a/tests/api/api-band-test.c
+++ b/tests/api/api-band-test.c
@@ -106,8 +106,8 @@  static int video_decode(const char *input_filename)
         return -1;
     }
 
-    if (strcmp(codec->name, "flv") && strcmp(codec->name, "mpeg4") && strcmp(codec->name, "huffyuv")) {
-        av_log(NULL, AV_LOG_ERROR, "Wrong codec\n");
+    if (!(codec->capabilities & AV_CODEC_CAP_DRAW_HORIZ_BAND)) {
+        av_log(NULL, AV_LOG_ERROR, "Codec does not support draw_horiz_band\n");
         return -1;
     }
 
@@ -222,7 +222,7 @@  int main(int argc, char **argv)
 {
     if (argc < 2)
     {
-        av_log(NULL, AV_LOG_ERROR, "Incorrect input: expected %s <name of a video file>\nNote that test works only for huffyuv, flv and mpeg4 decoders\n", argv[0]);
+        av_log(NULL, AV_LOG_ERROR, "Incorrect input: expected %s <name of a video file>\n", argv[0]);
         return 1;
     }