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