2017-03-06 19:16:23 +03:00
|
|
|
diff --git a/media/libspeex_resampler/src/resample.c b/media/libspeex_resampler/src/resample.c
|
2017-03-06 18:15:07 +03:00
|
|
|
--- a/media/libspeex_resampler/src/resample.c
|
|
|
|
+++ b/media/libspeex_resampler/src/resample.c
|
2017-03-06 19:16:23 +03:00
|
|
|
@@ -1141,18 +1141,19 @@ EXPORT int speex_resampler_set_rate_frac
|
|
|
|
|
|
|
|
st->num_rate /= fact;
|
|
|
|
st->den_rate /= fact;
|
|
|
|
|
2017-03-06 18:15:07 +03:00
|
|
|
if (old_den > 0)
|
|
|
|
{
|
|
|
|
for (i=0;i<st->nb_channels;i++)
|
|
|
|
{
|
2017-03-06 19:16:23 +03:00
|
|
|
- if (_muldiv(&st->samp_frac_num[i],st->samp_frac_num[i],st->den_rate,old_den) != RESAMPLER_ERR_SUCCESS)
|
2017-03-06 18:15:07 +03:00
|
|
|
- return RESAMPLER_ERR_OVERFLOW;
|
2017-03-06 19:16:23 +03:00
|
|
|
+ if (_muldiv(&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;
|
2017-03-06 18:15:07 +03:00
|
|
|
+ }
|
|
|
|
/* Safety net */
|
|
|
|
if (st->samp_frac_num[i] >= st->den_rate)
|
|
|
|
st->samp_frac_num[i] = st->den_rate-1;
|
|
|
|
}
|
|
|
|
}
|
2017-03-06 19:16:23 +03:00
|
|
|
|
2017-03-06 18:15:07 +03:00
|
|
|
if (st->initialised)
|
2017-03-06 19:16:23 +03:00
|
|
|
return update_filter(st);
|