changeset 8628:e49a2e1f0020 libavcodec

Replace calls to the deprecated function av_init_random() with corresponding calls to av_random_init().
author stefano
date Sun, 18 Jan 2009 23:04:33 +0000
parents d6bab465b82c
children 04423b2f6e0b
files cook.c elbg.h mpc7.c mpc8.c nellymoserdec.c roqvideoenc.c
diffstat 6 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/cook.c	Sun Jan 18 22:57:40 2009 +0000
+++ b/cook.c	Sun Jan 18 23:04:33 2009 +0000
@@ -1053,7 +1053,7 @@
     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;
--- a/elbg.h	Sun Jan 18 22:57:40 2009 +0000
+++ b/elbg.h	Sun Jan 18 23:04:33 2009 +0000
@@ -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,
--- a/mpc7.c	Sun Jan 18 22:57:40 2009 +0000
+++ b/mpc7.c	Sun Jan 18 23:04:33 2009 +0000
@@ -53,7 +53,7 @@
         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();
--- a/mpc8.c	Sun Jan 18 22:57:40 2009 +0000
+++ b/mpc8.c	Sun Jan 18 23:04:33 2009 +0000
@@ -100,7 +100,7 @@
         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();
--- a/nellymoserdec.c	Sun Jan 18 22:57:40 2009 +0000
+++ b/nellymoserdec.c	Sun Jan 18 23:04:33 2009 +0000
@@ -128,7 +128,7 @@
     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);
--- a/roqvideoenc.c	Sun Jan 18 22:57:40 2009 +0000
+++ b/roqvideoenc.c	Sun Jan 18 23:04:33 2009 +0000
@@ -929,7 +929,7 @@
 {
     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)) {