diff options
author | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-01-18 23:04:33 +0000 |
---|---|---|
committer | Stefano Sabatini <stefano.sabatini-lala@poste.it> | 2009-01-18 23:04:33 +0000 |
commit | 9c868219e91c65f84ccbf6881848a263975a8d9e (patch) | |
tree | 0d85f84a49745563b6cd91ca4ea6d6375c9803fc | |
parent | 199436b952c198e14d53a389438e232ef60f1982 (diff) | |
download | ffmpeg-9c868219e91c65f84ccbf6881848a263975a8d9e.tar.gz |
Replace calls to the deprecated function av_init_random() with
corresponding calls to av_random_init().
Originally committed as revision 16682 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | ffserver.c | 2 | ||||
-rw-r--r-- | libavcodec/cook.c | 2 | ||||
-rw-r--r-- | libavcodec/elbg.h | 2 | ||||
-rw-r--r-- | libavcodec/mpc7.c | 2 | ||||
-rw-r--r-- | libavcodec/mpc8.c | 2 | ||||
-rw-r--r-- | libavcodec/nellymoserdec.c | 2 | ||||
-rw-r--r-- | libavcodec/roqvideoenc.c | 2 | ||||
-rw-r--r-- | libavutil/internal.h | 2 | ||||
-rw-r--r-- | libavutil/random.c | 2 |
9 files changed, 9 insertions, 9 deletions
diff --git a/ffserver.c b/ffserver.c index 79d1e3ab72..d2bdcc328e 100644 --- a/ffserver.c +++ b/ffserver.c @@ -4485,7 +4485,7 @@ int main(int argc, char **argv) unsetenv("http_proxy"); /* Kill the http_proxy */ - av_init_random(av_gettime() + (getpid() << 16), &random_state); + av_random_init(&random_state, av_gettime() + (getpid() << 16)); memset(&sigact, 0, sizeof(sigact)); sigact.sa_handler = handle_child_exit; diff --git a/libavcodec/cook.c b/libavcodec/cook.c index 1affe03e7c..98c0568e55 100644 --- a/libavcodec/cook.c +++ b/libavcodec/cook.c @@ -1053,7 +1053,7 @@ static int cook_decode_init(AVCodecContext *avctx) q->bit_rate = avctx->bit_rate; /* Initialize RNG. */ - av_init_random(1, &q->random_state); + av_random_init(&q->random_state, 1); /* Initialize extradata related variables. */ q->samples_per_channel = q->samples_per_frame / q->nb_channels; diff --git a/libavcodec/elbg.h b/libavcodec/elbg.h index 9be0440e86..cbc1f98c1f 100644 --- a/libavcodec/elbg.h +++ b/libavcodec/elbg.h @@ -35,7 +35,7 @@ * @param numCB Number of points in the codebook. * @param num_steps The maximum number of steps. One step is already a good compromise between time and quality. * @param closest_cb Return the closest codebook to each point. Must be allocated. - * @param rand_state A random number generator state. Should be already initialised by av_init_random. + * @param rand_state A random number generator state. Should be already initialised by av_random_init. */ void ff_do_elbg(int *points, int dim, int numpoints, int *codebook, int numCB, int num_steps, int *closest_cb, diff --git a/libavcodec/mpc7.c b/libavcodec/mpc7.c index a22baac915..01b8a70454 100644 --- a/libavcodec/mpc7.c +++ b/libavcodec/mpc7.c @@ -53,7 +53,7 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx) return -1; } memset(c->oldDSCF, 0, sizeof(c->oldDSCF)); - av_init_random(0xDEADBEEF, &c->rnd); + av_random_init(&c->rnd, 0xDEADBEEF); dsputil_init(&c->dsp, avctx); c->dsp.bswap_buf((uint32_t*)buf, (const uint32_t*)avctx->extradata, 4); ff_mpc_init(); diff --git a/libavcodec/mpc8.c b/libavcodec/mpc8.c index 29f2e5f158..cafefe6bcd 100644 --- a/libavcodec/mpc8.c +++ b/libavcodec/mpc8.c @@ -100,7 +100,7 @@ static av_cold int mpc8_decode_init(AVCodecContext * avctx) return -1; } memset(c->oldDSCF, 0, sizeof(c->oldDSCF)); - av_init_random(0xDEADBEEF, &c->rnd); + av_random_init(&c->rnd, 0xDEADBEEF); dsputil_init(&c->dsp, avctx); ff_mpc_init(); diff --git a/libavcodec/nellymoserdec.c b/libavcodec/nellymoserdec.c index c0a856e2ac..e2a41917f2 100644 --- a/libavcodec/nellymoserdec.c +++ b/libavcodec/nellymoserdec.c @@ -128,7 +128,7 @@ static av_cold int decode_init(AVCodecContext * avctx) { NellyMoserDecodeContext *s = avctx->priv_data; s->avctx = avctx; - av_init_random(0, &s->random_state); + av_random_init(&s->random_state, 0); ff_mdct_init(&s->imdct_ctx, 8, 1); dsputil_init(&s->dsp, avctx); diff --git a/libavcodec/roqvideoenc.c b/libavcodec/roqvideoenc.c index a5622cd6fe..6e04f5c570 100644 --- a/libavcodec/roqvideoenc.c +++ b/libavcodec/roqvideoenc.c @@ -929,7 +929,7 @@ static int roq_encode_init(AVCodecContext *avctx) { RoqContext *enc = avctx->priv_data; - av_init_random(1, &enc->randctx); + av_random_init(&enc->randctx, 1); enc->framesSinceKeyframe = 0; if ((avctx->width & 0xf) || (avctx->height & 0xf)) { diff --git a/libavutil/internal.h b/libavutil/internal.h index ef1233d91c..2010e3008a 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -231,7 +231,7 @@ if((y)<(x)){\ #undef rand #define rand rand_is_forbidden_due_to_state_trashing_use_av_random #undef srand -#define srand srand_is_forbidden_due_to_state_trashing_use_av_init_random +#define srand srand_is_forbidden_due_to_state_trashing_use_av_random_init #undef random #define random random_is_forbidden_due_to_state_trashing_use_av_random #undef sprintf diff --git a/libavutil/random.c b/libavutil/random.c index bafdf7a377..9b5d1123c3 100644 --- a/libavutil/random.c +++ b/libavutil/random.c @@ -88,7 +88,7 @@ int main(void) int i, j; AVRandomState state; - av_init_random(0xdeadbeef, &state); + av_random_init(&state, 0xdeadbeef); for (j = 0; j < 10000; j++) { START_TIMER for (i = 0; i < 624; i++) { |