output/osx: check started in Close() and Cancel()

This commit is contained in:
Max Kellermann 2020-07-02 15:13:05 +02:00
parent f032925c2d
commit fe5b81e180

View File

@ -667,7 +667,8 @@ OSXOutput::Disable() noexcept
void
OSXOutput::Close() noexcept
{
AudioOutputUnitStop(au);
if (started)
AudioOutputUnitStop(au);
AudioUnitUninitialize(au);
delete ring_buffer;
}
@ -821,7 +822,11 @@ bool OSXOutput::Pause()
void
OSXOutput::Cancel() noexcept
{
AudioOutputUnitStop(au);
if (started) {
AudioOutputUnitStop(au);
started = false;
}
ring_buffer->reset();
#ifdef ENABLE_DSD
pcm_export->Reset();