libsndfile / libsamplerate

An audio Sample Rate Conversion library
http://libsndfile.github.io/libsamplerate/
BSD 2-Clause "Simplified" License
600 stars 167 forks source link

One input frame is not enough for variable ratio #221

Open RadoBuransky opened 3 months ago

RadoBuransky commented 3 months ago

In case of variable src_ratio the caller must provide more (at least 2?) input samples otherwise ratio stays the same. I think the reason is linear interpolation on this line: https://github.com/libsndfile/libsamplerate/blob/4858fb016550d677de2356486bcceda5aed85a72/src/src_linear.c#L112

Basically priv->out_gen is 0 and therefore src_ratio = state->last_ratio until the end of times.