decoder/Thread: fail decoder_input_stream_open() if STOP is received

Fixes an assertion failure in tag_ape_scan() which is because
decoder_input_stream_open() returns an "unready" InputStream.
This commit is contained in:
Max Kellermann 2016-04-21 13:14:40 +02:00
parent 21f17270a1
commit e8121fdc11
1 changed files with 4 additions and 2 deletions

View File

@ -68,8 +68,10 @@ decoder_input_stream_open(DecoderControl &dc, const char *uri, Error &error)
const ScopeLock protect(dc.mutex);
is->Update();
while (!is->IsReady() &&
dc.command != DecoderCommand::STOP) {
while (!is->IsReady()) {
if (dc.command == DecoderCommand::STOP)
return nullptr;
dc.Wait();
is->Update();