Fix spurious segfaults when ratio dips below 1.
This commit is contained in:
parent
d8d3442b29
commit
34713f40d1
16
audio/sinc.c
16
audio/sinc.c
|
@ -239,12 +239,7 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
||||||
|
|
||||||
while (frames)
|
while (frames)
|
||||||
{
|
{
|
||||||
process_sinc(re, output);
|
while (frames && re->time >= PHASES_WRAP)
|
||||||
output += 2;
|
|
||||||
out_frames++;
|
|
||||||
|
|
||||||
re->time += ratio;
|
|
||||||
while (re->time >= PHASES_WRAP)
|
|
||||||
{
|
{
|
||||||
re->buffer_l[re->ptr + TAPS] = re->buffer_l[re->ptr] = *input++;
|
re->buffer_l[re->ptr + TAPS] = re->buffer_l[re->ptr] = *input++;
|
||||||
re->buffer_r[re->ptr + TAPS] = re->buffer_r[re->ptr] = *input++;
|
re->buffer_r[re->ptr + TAPS] = re->buffer_r[re->ptr] = *input++;
|
||||||
|
@ -253,6 +248,15 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
||||||
re->time -= PHASES_WRAP;
|
re->time -= PHASES_WRAP;
|
||||||
frames--;
|
frames--;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (re->time >= PHASES_WRAP)
|
||||||
|
break;
|
||||||
|
|
||||||
|
process_sinc(re, output);
|
||||||
|
output += 2;
|
||||||
|
out_frames++;
|
||||||
|
|
||||||
|
re->time += ratio;
|
||||||
}
|
}
|
||||||
|
|
||||||
data->output_frames = out_frames;
|
data->output_frames = out_frames;
|
||||||
|
|
Loading…
Reference in New Issue