diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-24 14:26:41 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2016-12-24 14:46:25 +0100 |
commit | c4152fc42e480c41efb7f761b1bbe5f0bc43d5bc (patch) | |
tree | c0cefc290e923850662e434ec9a89e2318789a43 /libavutil | |
parent | 87f6f15460983119eead5ae00bda1822f80d75fb (diff) | |
download | ffmpeg-streaming-c4152fc42e480c41efb7f761b1bbe5f0bc43d5bc.zip ffmpeg-streaming-c4152fc42e480c41efb7f761b1bbe5f0bc43d5bc.tar.gz |
avutil/random_seed: Reduce the time needed on systems with very low precission clock()
This should fix issues on BSD
CLOCKS_PER_SEC is 128 on BSD while SUSv2 requires it to be a million
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/random_seed.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 179fb23..0c58c8f 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -87,7 +87,7 @@ static uint32_t get_generic_seed(void) for (;;) { clock_t t = clock(); - if (last_t + 2*last_td + 1 >= t) { + if (last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) >= t) { last_td = t - last_t; buffer[i & 511] = 1664525*buffer[i & 511] + 1013904223 + (last_td % 3294638521U); } else { |