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:
		@@ -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);
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user