diff options
author | Max Kellermann <max@musicpd.org> | 2020-10-01 20:35:21 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-10-01 20:44:11 +0200 |
commit | c0775d328cd9b0eb6175b690e541d1ea8b906261 (patch) | |
tree | 920e7846fa38afbce5bce1b303c90c538a5ce46d | |
parent | 4ca2c3318147f6521029e5f6b5f65a5f13fa92a5 (diff) |
output/Filtered: move try/catch from IteratePause() to caller
-rw-r--r-- | src/output/Filtered.cxx | 10 | ||||
-rw-r--r-- | src/output/Filtered.hxx | 2 | ||||
-rw-r--r-- | src/output/Thread.cxx | 8 |
3 files changed, 9 insertions, 11 deletions
diff --git a/src/output/Filtered.cxx b/src/output/Filtered.cxx index 45c957141..a38add5c4 100644 --- a/src/output/Filtered.cxx +++ b/src/output/Filtered.cxx @@ -196,13 +196,7 @@ FilteredAudioOutput::BeginPause() noexcept } bool -FilteredAudioOutput::IteratePause() noexcept +FilteredAudioOutput::IteratePause() { - try { - return output->Pause(); - } catch (...) { - FormatError(std::current_exception(), "Failed to pause %s", - GetLogName()); - return false; - } + return output->Pause(); } diff --git a/src/output/Filtered.hxx b/src/output/Filtered.hxx index 97d37765a..11a0ac742 100644 --- a/src/output/Filtered.hxx +++ b/src/output/Filtered.hxx @@ -227,7 +227,7 @@ public: void Cancel() noexcept; void BeginPause() noexcept; - bool IteratePause() noexcept; + bool IteratePause(); void EndPause() noexcept{ } diff --git a/src/output/Thread.cxx b/src/output/Thread.cxx index b42d517d7..232145ce1 100644 --- a/src/output/Thread.cxx +++ b/src/output/Thread.cxx @@ -338,10 +338,14 @@ AudioOutputControl::InternalPause(std::unique_lock<Mutex> &lock) noexcept if (!WaitForDelay(lock)) break; - bool success; - { + bool success = false; + try { const ScopeUnlock unlock(mutex); success = output->IteratePause(); + } catch (...) { + FormatError(std::current_exception(), + "Failed to pause %s", + GetLogName()); } if (!success) { |