Commit b93e3b2c authored by Max Kellermann's avatar Max Kellermann

output/Thread: move code to method InternalCloseError()

parent ae7fcf4c
......@@ -467,6 +467,14 @@ private:
void InternalClose(bool drain) noexcept;
/**
* An error has occurred, and this output must be closed.
*/
void InternalCloseError(std::exception_ptr e) noexcept {
Failure(e);
InternalClose(false);
}
/**
* Runs inside the OutputThread.
* Caller must lock the mutex.
*/
......
......@@ -232,8 +232,7 @@ try {
} catch (...) {
FormatError(std::current_exception(),
"Failed to filter for %s", GetLogName());
Failure(std::current_exception());
InternalClose(false);
InternalCloseError(std::current_exception());
return false;
}
......@@ -273,9 +272,7 @@ AudioOutputControl::PlayChunk() noexcept
} catch (...) {
FormatError(std::current_exception(),
"Failed to play on %s", GetLogName());
Failure(std::current_exception());
InternalClose(false);
InternalCloseError(std::current_exception());
return false;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment