Merge commit '01d245ef4392152dbdc78a6ba4dfa0a6e8b08e6f'
* commit '01d245ef4392152dbdc78a6ba4dfa0a6e8b08e6f':
random_seed: Rewrite the generic clock() based seed code
Conflicts:
libavutil/random_seed.c
See: 66531c75d3
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -33,10 +33,10 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "avassert.h"
|
#include "avassert.h"
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
#include "intreadwrite.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
#include "random_seed.h"
|
#include "random_seed.h"
|
||||||
#include "sha.h"
|
#include "sha.h"
|
||||||
#include "intreadwrite.h"
|
|
||||||
|
|
||||||
#ifndef TEST
|
#ifndef TEST
|
||||||
#define TEST 0
|
#define TEST 0
|
||||||
@@ -98,7 +98,7 @@ static uint32_t get_generic_seed(void)
|
|||||||
buffer[0] = buffer[1] = 0;
|
buffer[0] = buffer[1] = 0;
|
||||||
|
|
||||||
av_sha_init(sha, 160);
|
av_sha_init(sha, 160);
|
||||||
av_sha_update(sha, (uint8_t*)buffer, sizeof(buffer));
|
av_sha_update(sha, (const uint8_t *)buffer, sizeof(buffer));
|
||||||
av_sha_final(sha, digest);
|
av_sha_final(sha, digest);
|
||||||
return AV_RB32(digest) + AV_RB32(digest + 16);
|
return AV_RB32(digest) + AV_RB32(digest + 16);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user