Source code

Revision control

Copy as Markdown

Other Tools

diff --git a/src/resample.c b/src/resample.c
--- a/src/resample.c
+++ b/src/resample.c
@@ -1129,18 +1129,19 @@ EXPORT int speex_resampler_set_rate_frac
st->num_rate /= fact;
st->den_rate /= fact;
if (old_den > 0)
{
for (i=0;i<st->nb_channels;i++)
{
- if (multiply_frac(&st->samp_frac_num[i],st->samp_frac_num[i],st->den_rate,old_den) != RESAMPLER_ERR_SUCCESS)
- return RESAMPLER_ERR_OVERFLOW;
+ if (multiply_frac(&st->samp_frac_num[i],st->samp_frac_num[i],st->den_rate,old_den) != RESAMPLER_ERR_SUCCESS) {
+ st->samp_frac_num[i] = st->den_rate-1;
+ }
/* Safety net */
if (st->samp_frac_num[i] >= st->den_rate)
st->samp_frac_num[i] = st->den_rate-1;
}
}
if (st->initialised)
return update_filter(st);