decoder/Bridge: check for STOP before InputStream::IsReady()

If the DecoderThread gets woken up by a STOP command, this should be
detected as early as possible.
This commit is contained in:
Max Kellermann 2019-04-05 10:30:52 +02:00
parent 77af999b46
commit ac74f284aa
1 changed files with 3 additions and 3 deletions

View File

@ -368,15 +368,15 @@ DecoderBridge::OpenUri(const char *uri)
const std::lock_guard<Mutex> lock(mutex);
while (true) {
if (dc.command == DecoderCommand::STOP)
throw StopDecoder();
is->Update();
if (is->IsReady()) {
is->Check();
return is;
}
if (dc.command == DecoderCommand::STOP)
throw StopDecoder();
cond.wait(mutex);
}
}