Revision cc7b62af

View differences:

libavformat/timefilter.c
76 76
}
77 77

  
78 78
#ifdef TEST
79
#undef rand
79
#include "libavutil/lfg.h"
80
#define LFG_MAX ((1LL << 32) - 1)
81

  
80 82
int main(void)
81 83
{
84
    AVLFG prng;
82 85
    double n0,n1;
83 86
#define SAMPLES 1000
84 87
    double ideal[SAMPLES];
......
96 99
            double bestpar1=0.001;
97 100
            int better, i;
98 101

  
99
            srandom(123);
102
            av_lfg_init(&prng, 123);
100 103
            for(i=0; i<SAMPLES; i++){
101 104
                ideal[i]  = 10 + i + n1*i/(1000);
102
                samples[i]= ideal[i] + n0*(rand()-RAND_MAX/2)/(RAND_MAX*10LL);
105
                samples[i] = ideal[i] + n0 * (av_lfg_get(&prng) - LFG_MAX / 2)
106
                                           / (LFG_MAX * 10LL);
103 107
            }
104 108

  
105 109
            do{

Also available in: Unified diff