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()
|
MultipleOutputs::~MultipleOutputs()
|
||||||
{
|
{
|
||||||
for (auto i : outputs) {
|
for (auto i : outputs)
|
||||||
{
|
|
||||||
const ScopeLock lock(i->mutex);
|
|
||||||
i->DisableWait();
|
|
||||||
}
|
|
||||||
|
|
||||||
i->Finish();
|
i->Finish();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static AudioOutput *
|
static AudioOutput *
|
||||||
|
@ -276,9 +276,8 @@ AudioOutput::StopThread()
|
|||||||
void
|
void
|
||||||
AudioOutput::Finish()
|
AudioOutput::Finish()
|
||||||
{
|
{
|
||||||
LockCloseWait();
|
if (mixer != nullptr)
|
||||||
|
mixer_auto_close(mixer);
|
||||||
assert(!fail_timer.IsDefined());
|
|
||||||
|
|
||||||
if (thread.IsDefined())
|
if (thread.IsDefined())
|
||||||
StopThread();
|
StopThread();
|
||||||
|
@ -642,6 +642,7 @@ AudioOutput::Task()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
case Command::KILL:
|
case Command::KILL:
|
||||||
|
Disable();
|
||||||
pipe.Cancel();
|
pipe.Cancel();
|
||||||
CommandFinished();
|
CommandFinished();
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user