mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-02-09 14:14:39 +02:00
avutil/random_seed: Add the runtime in cycles of the main loop to the entropy pool
This should theoretically improve the randomness slightly Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2540d884f3fd7cfac503e048112098967be2569a) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
49fc295612
commit
7dac928e61
@ -97,8 +97,13 @@ static uint32_t get_generic_seed(void)
|
|||||||
last_t = t;
|
last_t = t;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(TEST)
|
if(TEST) {
|
||||||
buffer[0] = buffer[1] = 0;
|
buffer[0] = buffer[1] = 0;
|
||||||
|
} else {
|
||||||
|
#ifdef AV_READ_TIME
|
||||||
|
buffer[111] += AV_READ_TIME();
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
av_sha_init(sha, 160);
|
av_sha_init(sha, 160);
|
||||||
av_sha_update(sha, (const uint8_t *)buffer, sizeof(buffer));
|
av_sha_update(sha, (const uint8_t *)buffer, sizeof(buffer));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user