Showing the changes to libswresample (1 of 1 file). Show all
Unified · Split
| @@ -145,10 +145,11 @@ static void audiogen(void *data, enum AVSampleFormat sample_fmt, · 144 unmodified lines | ||
| 145 | 145 | double tabf1[SWR_CH_MAX]; |
| 146 | 146 | double tabf2[SWR_CH_MAX]; |
| 147 | 147 | double taba[SWR_CH_MAX]; |
| 148 | − unsigned static seed; | |
| 148 | + unsigned static rnd; | |
| 149 | 149 | |
| 150 | 150 | #define PUT_SAMPLE set(data, ch, k, channels, sample_fmt, v); |
| 151 | −#define dbl_rand(x) ((seed = seed * 1664525 + 1013904223)*2.0 / (double)UINT_MAX - 1) | |
| 151 | +#define uint_rand(x) (x = x * 1664525 + 1013904223) | |
| 152 | +#define dbl_rand(x) (uint_rand(x)*2.0 / (double)UINT_MAX - 1) | |
| 152 | 153 | k = 0; |
| 153 | 154 | |
| 154 | 155 | /* 1 second of single freq sinus at 1000 Hz */ |
| @@ -187,8 +188,8 @@ static void audiogen(void *data, enum AVSampleFormat sample_fmt, · 32 unmodified lines | ||
| 187 | 188 | /* 1 second of unrelated ramps for each channel */ |
| 188 | 189 | for (ch = 0; ch < channels; ch++) { |
| 189 | 190 | taba[ch] = 0; |
| 190 | − tabf1[ch] = 100 + (seed = seed * 1664525 + 1013904223) % 5000; | |
| 191 | − tabf2[ch] = 100 + (seed = seed * 1664525 + 1013904223) % 5000; | |
| 191 | + tabf1[ch] = 100 + uint_rand(rnd) % 5000; | |
| 192 | + tabf2[ch] = 100 + uint_rand(rnd) % 5000; | |
| 192 | 193 | } |
| 193 | 194 | for (i = 0; i < 1 * sample_rate && k < nb_samples; i++, k++) { |
| 194 | 195 | for (ch = 0; ch < channels; ch++) { |