Commit fb907f5f authored by Max Kellermann's avatar Max Kellermann

output/Thread: KILL implicitly closes and disables the AudioOutput

Reduce shutdown latency by two commands per output.
parent b107a158
......@@ -43,14 +43,8 @@ MultipleOutputs::MultipleOutputs(MixerListener &_mixer_listener)
MultipleOutputs::~MultipleOutputs()
{
for (auto i : outputs) {
{
const ScopeLock lock(i->mutex);
i->DisableWait();
}
for (auto i : outputs)
i->Finish();
}
}
static AudioOutput *
......
......@@ -276,9 +276,8 @@ AudioOutput::StopThread()
void
AudioOutput::Finish()
{
LockCloseWait();
assert(!fail_timer.IsDefined());
if (mixer != nullptr)
mixer_auto_close(mixer);
if (thread.IsDefined())
StopThread();
......
......@@ -642,6 +642,7 @@ AudioOutput::Task()
continue;
case Command::KILL:
Disable();
pipe.Cancel();
CommandFinished();
return;
......
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