26 #if HAVE_CRYPTGENRANDOM
39 int fd = open(file, O_RDONLY);
44 err = read(fd, dst,
sizeof(*dst));
59 float s = 0.000000000001;
61 for (i = 0; bits < 64; i++) {
63 if (last_t && fabs(t - last_t) > s || t == (clock_t) -1) {
64 if (i < 10000 && s < (1 << 24)) {
68 random = 2 * random + (i & 1);
80 random += random >> 32;
89 #if HAVE_CRYPTGENRANDOM
91 if (CryptAcquireContext(&provider,
NULL,
NULL, PROV_RSA_FULL,
92 CRYPT_VERIFYCONTEXT | CRYPT_SILENT)) {
93 BOOL ret = CryptGenRandom(provider,
sizeof(seed), (PBYTE) &seed);
94 CryptReleaseContext(provider, 0);
100 if (
read_random(&seed,
"/dev/urandom") ==
sizeof(seed))
102 if (
read_random(&seed,
"/dev/random") ==
sizeof(seed))
static int read_random(uint32_t *dst, const char *file)
static uint32_t get_generic_seed(void)
high precision timer, useful to profile code
static void close(AVCodecParserContext *s)
static BOOL(WINAPI *cond_wait)(pthread_cond_t *cond
uint32_t av_get_random_seed(void)
Get random data.