From b0b8f573bc32d0eee6d417e026b7647e6a963717 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Thu, 17 Nov 2016 22:52:44 +0100 Subject: [PATCH] decoder/API: copy exceptions to Decoder::error --- src/decoder/DecoderAPI.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/decoder/DecoderAPI.cxx b/src/decoder/DecoderAPI.cxx index a16fd3a36..f49c4c8a5 100644 --- a/src/decoder/DecoderAPI.cxx +++ b/src/decoder/DecoderAPI.cxx @@ -342,7 +342,10 @@ try { return nbytes; } catch (const std::runtime_error &e) { - LogError(e); + if (decoder != nullptr) + decoder->error = std::current_exception(); + else + LogError(e); return 0; } @@ -490,7 +493,7 @@ decoder_data(Decoder &decoder, /* the PCM conversion has failed - stop playback, since we have no better way to bail out */ - LogError(e); + decoder.error = std::current_exception(); return DecoderCommand::STOP; } } else {