From 9c868219e91c65f84ccbf6881848a263975a8d9e Mon Sep 17 00:00:00 2001 From: Stefano Sabatini Date: Sun, 18 Jan 2009 23:04:33 +0000 Subject: 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 --- libavcodec/cook.c | 2 +- libavcodec/elbg.h | 2 +- libavcodec/mpc7.c | 2 +- libavcodec/mpc8.c | 2 +- libavcodec/nellymoserdec.c | 2 +- libavcodec/roqvideoenc.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'libavcodec') 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)) { -- cgit v1.2.3