Re: [FFmpeg-devel] [PATCH] random_seed: Limit the time taken by get_generic_seed

2025-02-05 Thread Martin Storsjö
On Fri, 31 Jan 2025, Michael Niedermayer wrote: diff --git a/libavutil/random_seed.c b/libavutil/random_seed.c index 8a4e4f1fc0..8f969060a0 100644 --- a/libavutil/random_seed.c +++ b/libavutil/random_seed.c @@ -83,6 +83,7 @@ static uint32_t get_generic_seed(void) static uint32_t buffer[512]

Re: [FFmpeg-devel] [PATCH] random_seed: Limit the time taken by get_generic_seed

2025-01-30 Thread Michael Niedermayer
Hi Martin On Wed, Jan 29, 2025 at 11:53:53AM +0200, Martin Storsjö wrote: > On a Zen 5, on Ubuntu 24.04 (with CLOCKS_PER_SEC 100), the > value of clock() in this loop increments by 0 most of the time, > and when it does increment, it usually increments by 1 compared > to the previous round. >

[FFmpeg-devel] [PATCH] random_seed: Limit the time taken by get_generic_seed

2025-01-29 Thread Martin Storsjö
On a Zen 5, on Ubuntu 24.04 (with CLOCKS_PER_SEC 100), the value of clock() in this loop increments by 0 most of the time, and when it does increment, it usually increments by 1 compared to the previous round. Due to the "last_t + 2*last_td + (CLOCKS_PER_SEC > 1000) >= t" expression, we only m