output/Thread: move code to method InternalCloseError()
This commit is contained in:
parent
ae7fcf4c6b
commit
b93e3b2cf6
@ -466,6 +466,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user