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;
|
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.
|
* Runs inside the OutputThread.
|
||||||
* Caller must lock the mutex.
|
* Caller must lock the mutex.
|
||||||
|
@ -232,8 +232,7 @@ try {
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
FormatError(std::current_exception(),
|
FormatError(std::current_exception(),
|
||||||
"Failed to filter for %s", GetLogName());
|
"Failed to filter for %s", GetLogName());
|
||||||
Failure(std::current_exception());
|
InternalCloseError(std::current_exception());
|
||||||
InternalClose(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,9 +272,7 @@ AudioOutputControl::PlayChunk() noexcept
|
|||||||
} catch (...) {
|
} catch (...) {
|
||||||
FormatError(std::current_exception(),
|
FormatError(std::current_exception(),
|
||||||
"Failed to play on %s", GetLogName());
|
"Failed to play on %s", GetLogName());
|
||||||
Failure(std::current_exception());
|
InternalCloseError(std::current_exception());
|
||||||
|
|
||||||
InternalClose(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user