diff --git a/NEWS b/NEWS index 7107eeb31..3788d63a5 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,6 @@ ver 0.20.15 (not yet released) +* resampler + - soxr: clear internal state after manual song change * state file - make mount point restore errors non-fatal - fix crash when restoring mounts with incompatible database plugin diff --git a/src/pcm/SoxrResampler.cxx b/src/pcm/SoxrResampler.cxx index 621d3f970..868ad59fd 100644 --- a/src/pcm/SoxrResampler.cxx +++ b/src/pcm/SoxrResampler.cxx @@ -139,6 +139,14 @@ SoxrPcmResampler::Close() soxr_delete(soxr); } +void +SoxrPcmResampler::Reset() +{ +#if SOXR_THIS_VERSION >= SOXR_VERSION(0,1,2) + soxr_clear(soxr); +#endif +} + ConstBuffer SoxrPcmResampler::Resample(ConstBuffer src) { diff --git a/src/pcm/SoxrResampler.hxx b/src/pcm/SoxrResampler.hxx index 0be861179..9f3114a47 100644 --- a/src/pcm/SoxrResampler.hxx +++ b/src/pcm/SoxrResampler.hxx @@ -41,6 +41,7 @@ class SoxrPcmResampler final : public PcmResampler { public: AudioFormat Open(AudioFormat &af, unsigned new_sample_rate) override; void Close() override; + void Reset() override; ConstBuffer Resample(ConstBuffer src) override; };