Commit 3dcb0820 authored by Max Kellermann's avatar Max Kellermann

pcm/Resampler: add method Reset()

Hook for src_reset(), not yet used.
parent bece0230
......@@ -65,6 +65,12 @@ GluePcmResampler::Close()
resampler->Close();
}
void
GluePcmResampler::Reset()
{
resampler->Reset();
}
ConstBuffer<void>
GluePcmResampler::Resample(ConstBuffer<void> src)
{
......
......@@ -55,6 +55,11 @@ public:
return output_sample_format;
}
/**
* @see PcmResampler::Reset()
*/
void Reset();
ConstBuffer<void> Resample(ConstBuffer<void> src);
};
......
......@@ -114,6 +114,12 @@ LibsampleratePcmResampler::Close()
state = src_delete(state);
}
void
LibsampleratePcmResampler::Reset()
{
src_reset(state);
}
inline ConstBuffer<float>
LibsampleratePcmResampler::Resample2(ConstBuffer<float> src)
{
......
......@@ -44,6 +44,7 @@ class LibsampleratePcmResampler final : public PcmResampler {
public:
AudioFormat Open(AudioFormat &af, unsigned new_sample_rate) override;
void Close() override;
void Reset() override;
ConstBuffer<void> Resample(ConstBuffer<void> src) override;
private:
......
......@@ -55,6 +55,12 @@ public:
virtual void Close() = 0;
/**
* Reset the filter's state, e.g. drop/flush buffers.
*/
virtual void Reset() {
}
/**
* Resamples a block of PCM data.
*
* @param src the input buffer
......
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