summaryrefslogtreecommitdiff
path: root/src/output
diff options
context:
space:
mode:
authorYue Wang <Wang-Yue@github.com>2018-07-15 22:33:39 -0700
committerYue Wang <Wang-Yue@github.com>2018-07-16 09:06:07 -0700
commitc58dffa685310028c6c4d5b9aa09507e9f0e2b44 (patch)
tree77d49c03e86ab3b97b8047f013d31bb564a38661 /src/output
parent1d30df9b1567c36a1713a9f91a0f05d40d84d763 (diff)
Implement Cancel() for OSXOutputPlugin
Diffstat (limited to 'src/output')
-rw-r--r--src/output/plugins/OSXOutputPlugin.cxx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx
index 67fd9ddfe..9894eff25 100644
--- a/src/output/plugins/OSXOutputPlugin.cxx
+++ b/src/output/plugins/OSXOutputPlugin.cxx
@@ -101,6 +101,7 @@ private:
std::chrono::steady_clock::duration Delay() const noexcept override;
size_t Play(const void *chunk, size_t size) override;
bool Pause() override;
+ void Cancel() noexcept override;
};
static constexpr Domain osx_output_domain("osx_output");
@@ -909,7 +910,18 @@ bool OSXOutput::Pause() {
}
return true;
}
-
+
+void
+OSXOutput::Cancel() noexcept
+{
+ AudioOutputUnitStop(au);
+ ring_buffer->reset();
+#ifdef ENABLE_DSD
+ pcm_export->Reset();
+#endif
+ AudioOutputUnitStart(au);
+}
+
int
osx_output_get_volume(OSXOutput &output)
{