diff options
author | Michael Niedermayer <[email protected]> | 2015-12-09 15:18:53 +0100 |
---|---|---|
committer | Michael Niedermayer <[email protected]> | 2016-05-01 05:00:44 +0200 |
commit | 3097c10ee341b253a1a7a6e6035af96e9e7e900d (patch) | |
tree | 478d54a99ee9d559a66f30f2861b43fb263e7f40 | |
parent | 3433e52d48ace11f5cbfd438ee127f7ae6eccb1b (diff) |
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 <[email protected]>
(cherry picked from commit 2540d884f3fd7cfac503e048112098967be2569a)
Signed-off-by: Michael Niedermayer <[email protected]>
-rw-r--r-- | libavutil/random_seed.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 8aa8c3879b..5af8e9e524 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -97,8 +97,13 @@ static uint32_t get_generic_seed(void) last_t = t; } - if(TEST) + if(TEST) { buffer[0] = buffer[1] = 0; + } else { +#ifdef AV_READ_TIME + buffer[111] += AV_READ_TIME(); +#endif + } av_sha_init(sha, 160); av_sha_update(sha, (const uint8_t *)buffer, sizeof(buffer)); |