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