pcm/Resampler: add method Reset()
Hook for src_reset(), not yet used.
This commit is contained in:
parent
bece023028
commit
3dcb082015
|
@ -65,6 +65,12 @@ GluePcmResampler::Close()
|
||||||
resampler->Close();
|
resampler->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
GluePcmResampler::Reset()
|
||||||
|
{
|
||||||
|
resampler->Reset();
|
||||||
|
}
|
||||||
|
|
||||||
ConstBuffer<void>
|
ConstBuffer<void>
|
||||||
GluePcmResampler::Resample(ConstBuffer<void> src)
|
GluePcmResampler::Resample(ConstBuffer<void> src)
|
||||||
{
|
{
|
||||||
|
|
|
@ -55,6 +55,11 @@ public:
|
||||||
return output_sample_format;
|
return output_sample_format;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see PcmResampler::Reset()
|
||||||
|
*/
|
||||||
|
void Reset();
|
||||||
|
|
||||||
ConstBuffer<void> Resample(ConstBuffer<void> src);
|
ConstBuffer<void> Resample(ConstBuffer<void> src);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -114,6 +114,12 @@ LibsampleratePcmResampler::Close()
|
||||||
state = src_delete(state);
|
state = src_delete(state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
LibsampleratePcmResampler::Reset()
|
||||||
|
{
|
||||||
|
src_reset(state);
|
||||||
|
}
|
||||||
|
|
||||||
inline ConstBuffer<float>
|
inline ConstBuffer<float>
|
||||||
LibsampleratePcmResampler::Resample2(ConstBuffer<float> src)
|
LibsampleratePcmResampler::Resample2(ConstBuffer<float> src)
|
||||||
{
|
{
|
||||||
|
|
|
@ -44,6 +44,7 @@ class LibsampleratePcmResampler 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;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -54,6 +54,12 @@ public:
|
||||||
*/
|
*/
|
||||||
virtual void Close() = 0;
|
virtual void Close() = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reset the filter's state, e.g. drop/flush buffers.
|
||||||
|
*/
|
||||||
|
virtual void Reset() {
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Resamples a block of PCM data.
|
* Resamples a block of PCM data.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue