diff --git a/configure b/configure index 7662f37133633887fbef984b14cacf0237c33f15..dc1d2eb8072d69bfaab3b45bebfee1c4c351d4fd 100755 --- a/configure +++ b/configure @@ -1841,6 +1841,7 @@ MATH_FUNCS=" SYSTEM_FUNCS=" access aligned_malloc + arc4random clock_gettime closesocket CommandLineToArgvW @@ -5232,6 +5233,7 @@ check_func ${malloc_prefix}memalign && enable memalign check_func ${malloc_prefix}posix_memalign && enable posix_memalign check_func access +check_func arc4random check_func_headers time.h clock_gettime || { check_func_headers time.h clock_gettime -lrt && add_extralibs -lrt && LIBRT="-lrt"; } check_func fcntl check_func fork diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 8aa8c3879b7c2ddee93037be9ac43b272dc3f053..205a636f92502591248a6d8c14e8cd89c00e06ea 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -121,6 +121,10 @@ uint32_t av_get_random_seed(void) } #endif +#if HAVE_ARC4RANDOM + return arc4random(); +#endif + if (read_random(&seed, "/dev/urandom") == sizeof(seed)) return seed; if (read_random(&seed, "/dev/random") == sizeof(seed))