Fixed streams being able to go inactive multiple times in a row

This commit is contained in:
Thulinma 2017-06-23 22:30:12 +02:00
parent 194a717ad6
commit f695e23ffc

View file

@ -322,14 +322,17 @@ void Controller::SharedMemStats(void * config){
if (activeStreams.size()){
for (std::map<std::string, uint8_t>::iterator it = activeStreams.begin(); it != activeStreams.end(); ++it){
uint8_t newState = Util::getStreamStatus(it->first);
if (newState != activeStreams[it->first]){
uint8_t oldState = activeStreams[it->first];
if (newState != oldState){
activeStreams[it->first] = newState;
if (newState == STRMSTAT_READY){
streamStarted(it->first);
}else{
if (oldState == STRMSTAT_READY){
streamStopped(it->first);
}
}
}
if (newState == STRMSTAT_OFF){
inactiveStreams.insert(it->first);
}