[FFmpeg-cvslog] r23932 - trunk/libavutil/random_seed.c

mru subversion
Thu Jul 1 13:43:30 CEST 2010


Author: mru
Date: Thu Jul  1 13:43:30 2010
New Revision: 23932

Log:
random_seed: simplify

Modified:
   trunk/libavutil/random_seed.c

Modified: trunk/libavutil/random_seed.c
==============================================================================
--- trunk/libavutil/random_seed.c	Thu Jul  1 13:40:54 2010	(r23931)
+++ trunk/libavutil/random_seed.c	Thu Jul  1 13:43:30 2010	(r23932)
@@ -40,12 +40,10 @@ static int read_random(uint32_t *dst, co
 uint32_t av_get_random_seed(void)
 {
     uint32_t seed;
-    int err;
 
-    err = read_random(&seed, "/dev/urandom");
-    if (err != sizeof(seed))
-        err = read_random(&seed, "/dev/random");
-    if (err == sizeof(seed))
+    if (read_random(&seed, "/dev/urandom") == sizeof(seed))
+        return seed;
+    if (read_random(&seed, "/dev/random")  == sizeof(seed))
         return seed;
 
 #ifdef AV_READ_TIME



More information about the ffmpeg-cvslog mailing list