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);
|
const std::lock_guard<Mutex> lock(mutex);
|
||||||
while (true) {
|
while (true) {
|
||||||
|
if (dc.command == DecoderCommand::STOP)
|
||||||
|
throw StopDecoder();
|
||||||
|
|
||||||
is->Update();
|
is->Update();
|
||||||
if (is->IsReady()) {
|
if (is->IsReady()) {
|
||||||
is->Check();
|
is->Check();
|
||||||
return is;
|
return is;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dc.command == DecoderCommand::STOP)
|
|
||||||
throw StopDecoder();
|
|
||||||
|
|
||||||
cond.wait(mutex);
|
cond.wait(mutex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user