output/Thread: move code to method InternalDrain()
This commit is contained in:
parent
b93e3b2cf6
commit
b0199245d5
|
@ -519,6 +519,13 @@ private:
|
|||
*/
|
||||
void InternalPause() noexcept;
|
||||
|
||||
/**
|
||||
* Runs inside the OutputThread.
|
||||
* Caller must lock the mutex.
|
||||
* Handles exceptions.
|
||||
*/
|
||||
void InternalDrain() noexcept;
|
||||
|
||||
/**
|
||||
* The OutputThread.
|
||||
*/
|
||||
|
|
|
@ -362,6 +362,14 @@ AudioOutputControl::InternalPause() noexcept
|
|||
skip_delay = true;
|
||||
}
|
||||
|
||||
inline void
|
||||
AudioOutputControl::InternalDrain() noexcept
|
||||
{
|
||||
const ScopeUnlock unlock(mutex);
|
||||
|
||||
output->Drain();
|
||||
}
|
||||
|
||||
void
|
||||
AudioOutputControl::Task()
|
||||
{
|
||||
|
@ -421,10 +429,8 @@ AudioOutputControl::Task()
|
|||
continue;
|
||||
|
||||
case Command::DRAIN:
|
||||
if (open) {
|
||||
const ScopeUnlock unlock(mutex);
|
||||
output->Drain();
|
||||
}
|
||||
if (open)
|
||||
InternalDrain();
|
||||
|
||||
CommandFinished();
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue