[FFmpeg-devel] [PATCH] Make av_get_random_seed not block when waiting for more entropy

Martin Storsjö martin
Tue Jun 29 19:53:47 CEST 2010


On Tue, 29 Jun 2010, M?ns Rullg?rd wrote:

> This will still block if urandom isn't available.  How about this?

> From cb60e983c550c2bdffc5fc07075336fb7c465fe9 Mon Sep 17 00:00:00 2001
> From: Mans Rullgard <mans at mansr.com>
> Date: Tue, 29 Jun 2010 14:22:51 +0100
> Subject: [PATCH] Make av_get_random_seed() non-blocking
> 
> Attempt to read from /dev/urandom and /dev/random with O_NONBLOCK set.
> If neither succeeds, proceed with fallbacks.

In general, this looks like an even better alternative. Neither fcntl, 
F_SETFL, F_GETFL nor O_NONBLOCK are available on windows, though, so they 
need to be hidden within some kind of ifdef.

// Martin



More information about the ffmpeg-devel mailing list