summaryrefslogtreecommitdiff
path: root/libavutil/random_seed.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-12-09 15:18:53 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-03-10 22:56:37 +0100
commit2540d884f3fd7cfac503e048112098967be2569a (patch)
tree64f0702ae3ee1eb4cfe497fbaaf3c1cb5fc5ab1a /libavutil/random_seed.c
parent73d1398f0c4ce2de16790f46e05a79242137d153 (diff)
downloadffmpeg-2540d884f3fd7cfac503e048112098967be2569a.tar.gz
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>
Diffstat (limited to 'libavutil/random_seed.c')
-rw-r--r--libavutil/random_seed.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c
index 205a636f92..0821550bc8 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));