decoder/Thread: clear the command after catching an exception

If an early exception gets caught (e.g. from
AllocatedPath::FromUTF8Throw()) before
DecoderControl::CommandFinishedLocked() is called, the decoder thread
would go in an endless loop, because DecoderCommand::START is still
set.

Closes #118
This commit is contained in:
Max Kellermann
2017-09-27 17:08:16 +02:00
parent ea80587ddb
commit fa67c2548a
2 changed files with 2 additions and 0 deletions

View File

@@ -508,6 +508,7 @@ try {
decoder_run_song(dc, song, uri_utf8, path_fs);
} catch (...) {
dc.state = DecoderState::ERROR;
dc.command = DecoderCommand::NONE;
dc.error = std::current_exception();
dc.client_cond.signal();
}