pcm/SoxrResampler: implement method Reset()

This commit is contained in:
Max Kellermann 2018-01-02 19:07:45 +01:00
parent ff624075a8
commit c68ed40661
3 changed files with 11 additions and 0 deletions

2
NEWS
View File

@ -1,4 +1,6 @@
ver 0.20.15 (not yet released) ver 0.20.15 (not yet released)
* resampler
- soxr: clear internal state after manual song change
* state file * state file
- make mount point restore errors non-fatal - make mount point restore errors non-fatal
- fix crash when restoring mounts with incompatible database plugin - fix crash when restoring mounts with incompatible database plugin

View File

@ -139,6 +139,14 @@ SoxrPcmResampler::Close()
soxr_delete(soxr); soxr_delete(soxr);
} }
void
SoxrPcmResampler::Reset()
{
#if SOXR_THIS_VERSION >= SOXR_VERSION(0,1,2)
soxr_clear(soxr);
#endif
}
ConstBuffer<void> ConstBuffer<void>
SoxrPcmResampler::Resample(ConstBuffer<void> src) SoxrPcmResampler::Resample(ConstBuffer<void> src)
{ {

View File

@ -41,6 +41,7 @@ class SoxrPcmResampler final : public PcmResampler {
public: public:
AudioFormat Open(AudioFormat &af, unsigned new_sample_rate) override; AudioFormat Open(AudioFormat &af, unsigned new_sample_rate) override;
void Close() override; void Close() override;
void Reset() override;
ConstBuffer<void> Resample(ConstBuffer<void> src) override; ConstBuffer<void> Resample(ConstBuffer<void> src) override;
}; };