diff --git a/src/controller/controller_statistics.cpp b/src/controller/controller_statistics.cpp index ee23a088..3699d027 100644 --- a/src/controller/controller_statistics.cpp +++ b/src/controller/controller_statistics.cpp @@ -322,12 +322,15 @@ void Controller::SharedMemStats(void * config){ if (activeStreams.size()){ for (std::map::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{ - streamStopped(it->first); + if (oldState == STRMSTAT_READY){ + streamStopped(it->first); + } } } if (newState == STRMSTAT_OFF){