DecoderAPI: stop decoder on MPD error

This commit adds the basic infrastructure for reporting bugs from
DecoderAPI.cxx via DecoderThread.cxx to DecoderControl.
This commit is contained in:
Max Kellermann
2013-11-13 20:57:09 +01:00
parent f1ca61d7d7
commit 4ee147ea34
3 changed files with 17 additions and 1 deletions

View File

@@ -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;