decoder/Control: convert error from Error to std::exception_ptr

Prepare full C++ exception support in the decoder thread.
This commit is contained in:
Max Kellermann
2016-09-08 17:14:11 +02:00
parent 0ce72cbf9d
commit 308010794a
4 changed files with 35 additions and 24 deletions

View File

@@ -33,6 +33,7 @@
#include "tag/Tag.hxx"
#include "Idle.hxx"
#include "util/Domain.hxx"
#include "util/Error.hxx"
#include "thread/Name.hxx"
#include "Log.hxx"
@@ -372,9 +373,10 @@ Player::StopDecoder()
bool
Player::ForwardDecoderError()
{
Error error = dc.GetError();
if (error.IsDefined()) {
pc.SetError(PlayerError::DECODER, std::move(error));
try {
dc.CheckRethrowError();
} catch (...) {
pc.SetError(PlayerError::DECODER, std::current_exception());
return false;
}