[PR] swresample/tests/swresample: Avoid av_assert2, remove ASSERT_LEVEL override (PR #24111)

mkver via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178653935344.59.622932105691795798@29965ddac10e>
PR #24111 opened by mkver
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24111
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24111.patch

Said #define ASSERT_LEVEL 2 was ineffective because it followed
the inclusion of avassert.h. It only leads to warnings when
ASSERT_LEVEL is defined to something other than 2 (it is not
defined by default).

Also avoid using av_assert2() in a test tool: These are supposed to
be picky, so using always-enabled av_assert0 is appropriate.
This was probably the intention of the ASSERT_LEVEL override
all along.



>From ae713adf4ab7429c907d5b0d364c003c866f6e7b Mon Sep 17 00:00:00 2001
From: Andreas Rheinhardt <[email protected]>
Date: Wed, 12 Aug 2026 14:39:41 +0200
Subject: [PATCH] swresample/tests/swresample: Avoid av_assert2, remove
 ASSERT_LEVEL override

Said #define ASSERT_LEVEL 2 was ineffective because it followed
the inclusion of avassert.h. It only leads to warnings when
ASSERT_LEVEL is defined to something other than 2 (it is not
defined by default).

Also avoid using av_assert2() in a test tool: These are supposed to
be picky, so using always-enabled av_assert0 is appropriate.
This was probably the intention of the ASSERT_LEVEL override
all along.

Signed-off-by: Andreas Rheinhardt <[email protected]>
---
 libswresample/tests/swresample.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/libswresample/tests/swresample.c b/libswresample/tests/swresample.c
index 2a5f9d59c4..7a90ad93df 100644
--- a/libswresample/tests/swresample.c
+++ b/libswresample/tests/swresample.c
@@ -32,8 +32,6 @@
 
 #define SWR_CH_MAX 32
 
-#define ASSERT_LEVEL 2
-
 static double get(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFormat f){
     const uint8_t *p;
     if(av_sample_fmt_is_planar(f)){
@@ -69,7 +67,7 @@ static void  set(uint8_t *a[], int ch, int index, int ch_count, enum AVSampleFor
     case AV_SAMPLE_FMT_S32: ((int32_t*)p)[index]= av_clipl_int32(llrint(v*2147483647));   break;
     case AV_SAMPLE_FMT_FLT: ((float  *)p)[index]= v;                                      break;
     case AV_SAMPLE_FMT_DBL: ((double *)p)[index]= v;                                      break;
-    default: av_assert2(0);
+    default: av_assert0(0);
     }
 }
 
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.