output/Thread: KILL implicitly closes and disables the AudioOutput
Reduce shutdown latency by two commands per output.
This commit is contained in:
parent
b107a1583f
commit
fb907f5f76
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user