Commit 4adf0897 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

speex resampler: add 10% slack output space

This should fix buffer underflows when changing the playback rate.
We probably should instead reallocate the buffer and resume resampling
when the situation occurs, but that would be a lot more complicated.
(cherry picked from commit 86d9aabf)
parent 642610c6
......@@ -111,7 +111,7 @@ static block_t *Resample (filter_t *filter, block_t *in)
const unsigned orate = filter->fmt_out.audio.i_rate;
spx_uint32_t ilen = in->i_nb_samples;
spx_uint32_t olen = ((ilen + 2) * orate) / irate;
spx_uint32_t olen = ((ilen + 2) * orate * 11) / (irate * 10);
block_t *out = block_Alloc (olen * framesize);
if (unlikely(out == NULL))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment