output/MultipleOutputs: move code to AudioOutput::EnableDisableWait()
This commit is contained in:
parent
ced3f320eb
commit
b107a1583f
@ -335,6 +335,23 @@ public:
|
|||||||
*/
|
*/
|
||||||
void DisableWait();
|
void DisableWait();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attempt to enable or disable the device as specified by the
|
||||||
|
* #enabled attribute; attempt to sync it with #really_enabled
|
||||||
|
* (wrapper for EnableWait() or DisableWait()).
|
||||||
|
*
|
||||||
|
* Caller must lock the mutex.
|
||||||
|
*/
|
||||||
|
void EnableDisableWait() {
|
||||||
|
if (enabled == really_enabled)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (enabled)
|
||||||
|
EnableWait();
|
||||||
|
else
|
||||||
|
DisableWait();
|
||||||
|
}
|
||||||
|
|
||||||
void LockPauseAsync();
|
void LockPauseAsync();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -112,13 +112,7 @@ MultipleOutputs::EnableDisable()
|
|||||||
{
|
{
|
||||||
for (auto ao : outputs) {
|
for (auto ao : outputs) {
|
||||||
const ScopeLock lock(ao->mutex);
|
const ScopeLock lock(ao->mutex);
|
||||||
|
ao->EnableDisableWait();
|
||||||
if (ao->enabled != ao->really_enabled) {
|
|
||||||
if (ao->enabled)
|
|
||||||
ao->EnableWait();
|
|
||||||
else
|
|
||||||
ao->DisableWait();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user