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:
parent
77af999b46
commit
ac74f284aa
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue