From 4ee147ea34057c0bcef31afed55f98b025b997dc Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 13 Nov 2013 20:57:09 +0100 Subject: DecoderAPI: stop decoder on MPD error This commit adds the basic infrastructure for reporting bugs from DecoderAPI.cxx via DecoderThread.cxx to DecoderControl. --- src/DecoderThread.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/DecoderThread.cxx') diff --git a/src/DecoderThread.cxx b/src/DecoderThread.cxx index 4d0bc13b5..2df131d19 100644 --- a/src/DecoderThread.cxx +++ b/src/DecoderThread.cxx @@ -360,7 +360,12 @@ decoder_run_song(DecoderControl &dc, dc.Lock(); - if (ret) + if (decoder.error.IsDefined()) { + /* copy the Error from sruct Decoder to + DecoderControl */ + dc.state = DecoderState::ERROR; + dc.error = std::move(decoder.error); + } else if (ret) dc.state = DecoderState::STOP; else { dc.state = DecoderState::ERROR; -- cgit v1.2.3