mirror of
https://github.com/libretro/RetroArch
synced 2025-02-09 09:39:56 +00:00
Fix hermite cracking when ratio < 1.0.
This commit is contained in:
parent
b023687d04
commit
ccd1449aa8
@ -64,8 +64,22 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
||||
const float *in_data = data->data_in;
|
||||
float *out_data = data->data_out;
|
||||
|
||||
for (size_t i = 0; i < in_frames; i++)
|
||||
size_t i = 0;
|
||||
while (i < in_frames)
|
||||
{
|
||||
while (re->r_frac >= 1.0 && i < in_frames)
|
||||
{
|
||||
re->r_frac -= 1.0;
|
||||
for (unsigned i = 0; i < CHANNELS; i++)
|
||||
{
|
||||
re->chan_data[i][0] = re->chan_data[i][1];
|
||||
re->chan_data[i][1] = re->chan_data[i][2];
|
||||
re->chan_data[i][2] = re->chan_data[i][3];
|
||||
re->chan_data[i][3] = *in_data++;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
while (re->r_frac <= 1.0)
|
||||
{
|
||||
re->r_frac += r_step;
|
||||
@ -77,18 +91,6 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
||||
}
|
||||
processed_out++;
|
||||
}
|
||||
|
||||
while (re->r_frac >= 1.0)
|
||||
{
|
||||
re->r_frac -= 1.0;
|
||||
for (unsigned i = 0; i < CHANNELS; i++)
|
||||
{
|
||||
re->chan_data[i][0] = re->chan_data[i][1];
|
||||
re->chan_data[i][1] = re->chan_data[i][2];
|
||||
re->chan_data[i][2] = re->chan_data[i][3];
|
||||
re->chan_data[i][3] = *in_data++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
data->output_frames = processed_out;
|
||||
|
15
audio/sinc.c
15
audio/sinc.c
@ -254,14 +254,13 @@ void resampler_process(rarch_resampler_t *re, struct resampler_data *data)
|
||||
frames--;
|
||||
}
|
||||
|
||||
if (re->time >= PHASES)
|
||||
break;
|
||||
|
||||
process_sinc(re, output);
|
||||
output += 2;
|
||||
out_frames++;
|
||||
|
||||
re->time += ratio;
|
||||
while (re->time < PHASES)
|
||||
{
|
||||
process_sinc(re, output);
|
||||
output += 2;
|
||||
out_frames++;
|
||||
re->time += ratio;
|
||||
}
|
||||
}
|
||||
|
||||
data->output_frames = out_frames;
|
||||
|
Loading…
x
Reference in New Issue
Block a user