mirror of
https://github.com/libretro/RetroArch.git
synced 2024-11-28 18:50:29 +00:00
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)
|
||||
{
|
||||
process_sinc(re, output);
|
||||
output += 2;
|
||||
out_frames++;
|
||||
|
||||
re->time += ratio;
|
||||
while (re->time >= PHASES_WRAP)
|
||||
while (frames && re->time >= PHASES_WRAP)
|
||||
{
|
||||
re->buffer_l[re->ptr + TAPS] = re->buffer_l[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;
|
||||
frames--;
|
||||
}
|
||||
|
||||
if (re->time >= PHASES_WRAP)
|
||||
break;
|
||||
|
||||
process_sinc(re, output);
|
||||
output += 2;
|
||||
out_frames++;
|
||||
|
||||
re->time += ratio;
|
||||
}
|
||||
|
||||
data->output_frames = out_frames;
|
||||
|
Loading…
Reference in New Issue
Block a user