output/Internal: remove mutex code from BeginPause(), IteratePause()
This commit is contained in:
parent
8f42ba13ef
commit
15dcaeda0f
@ -120,7 +120,6 @@ AudioOutput::Close(bool drain) noexcept
|
|||||||
void
|
void
|
||||||
AudioOutput::BeginPause() noexcept
|
AudioOutput::BeginPause() noexcept
|
||||||
{
|
{
|
||||||
const ScopeUnlock unlock(mutex);
|
|
||||||
ao_plugin_cancel(*this);
|
ao_plugin_cancel(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -128,7 +127,6 @@ bool
|
|||||||
AudioOutput::IteratePause() noexcept
|
AudioOutput::IteratePause() noexcept
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
const ScopeUnlock unlock(mutex);
|
|
||||||
return ao_plugin_pause(*this);
|
return ao_plugin_pause(*this);
|
||||||
} catch (const std::runtime_error &e) {
|
} catch (const std::runtime_error &e) {
|
||||||
FormatError(e, "\"%s\" [%s] failed to pause",
|
FormatError(e, "\"%s\" [%s] failed to pause",
|
||||||
|
@ -343,7 +343,11 @@ AudioOutputControl::InternalPlay() noexcept
|
|||||||
inline void
|
inline void
|
||||||
AudioOutputControl::InternalPause() noexcept
|
AudioOutputControl::InternalPause() noexcept
|
||||||
{
|
{
|
||||||
output->BeginPause();
|
{
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
|
output->BeginPause();
|
||||||
|
}
|
||||||
|
|
||||||
pause = true;
|
pause = true;
|
||||||
|
|
||||||
CommandFinished();
|
CommandFinished();
|
||||||
@ -352,14 +356,24 @@ AudioOutputControl::InternalPause() noexcept
|
|||||||
if (!WaitForDelay())
|
if (!WaitForDelay())
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (!output->IteratePause()) {
|
bool success;
|
||||||
|
{
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
|
success = output->IteratePause();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!success) {
|
||||||
InternalClose(false);
|
InternalClose(false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (command == Command::NONE);
|
} while (command == Command::NONE);
|
||||||
|
|
||||||
pause = false;
|
pause = false;
|
||||||
output->EndPause();
|
|
||||||
|
{
|
||||||
|
const ScopeUnlock unlock(mutex);
|
||||||
|
output->EndPause();
|
||||||
|
}
|
||||||
|
|
||||||
skip_delay = true;
|
skip_delay = true;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user