From 78a73eac5345d1d1b3eb9108d1a9bcfc0bd09fa8 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 11 Jan 2017 15:41:28 +0100 Subject: [PATCH] pcm/Export: add (dummy) method Cancel() We'll have some code for it soon. --- src/output/plugins/AlsaOutputPlugin.cxx | 2 ++ src/output/plugins/OssOutputPlugin.cxx | 4 ++++ src/pcm/PcmExport.hxx | 6 ++++++ 3 files changed, 12 insertions(+) diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index 90b74c0bb..341802bb3 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -826,6 +826,8 @@ AlsaOutput::Cancel() must_prepare = true; snd_pcm_drop(pcm); + + pcm_export->Reset(); } inline void diff --git a/src/output/plugins/OssOutputPlugin.cxx b/src/output/plugins/OssOutputPlugin.cxx index 7c51d435f..d02a8263b 100644 --- a/src/output/plugins/OssOutputPlugin.cxx +++ b/src/output/plugins/OssOutputPlugin.cxx @@ -659,6 +659,10 @@ OssOutput::Cancel() ioctl(fd, SNDCTL_DSP_RESET, 0); DoClose(); } + +#ifdef AFMT_S24_PACKED + pcm_export->Reset(); +#endif } inline size_t diff --git a/src/pcm/PcmExport.hxx b/src/pcm/PcmExport.hxx index 7102ff32f..e7cbf9f08 100644 --- a/src/pcm/PcmExport.hxx +++ b/src/pcm/PcmExport.hxx @@ -149,6 +149,12 @@ struct PcmExport { void Open(SampleFormat sample_format, unsigned channels, Params params); + /** + * Reset the filter's state, e.g. drop/flush buffers. + */ + void Reset() { + } + /** * Calculate the size of one output frame. */