[FFmpeg-devel] [PATCH 2/2] libavutil/random_seed: Skip testing generic seed twice

Michael Niedermayer michael at niedermayer.cc
Tue Jan 25 12:21:09 EET 2022


If no platform specific random seed is supported then the generic code
was tested twice, this is unneeded

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavutil/random_seed.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
index 509b74936c..a8be2d4991 100644
--- a/libavutil/random_seed.c
+++ b/libavutil/random_seed.c
@@ -141,5 +141,11 @@ uint32_t av_get_random_seed(void)
         return seed;
     if (read_random(&seed, "/dev/random")  == sizeof(seed))
         return seed;
+#if TEST
+    { // for testing we test get_generic_seed() seperatly so doing it here too is a waste of time
+        static int x;
+        return x++;
+    }
+#endif
     return get_generic_seed();
 }
-- 
2.17.1



More information about the ffmpeg-devel mailing list