Browse Source

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>
tags/n3.1
Michael Niedermayer 10 years ago
parent
commit
2540d884f3
1 changed files with 6 additions and 1 deletions
  1. +6
    -1
      libavutil/random_seed.c

+ 6
- 1
libavutil/random_seed.c View File

@@ -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));


Loading…
Cancel
Save