diff --git a/protocol/dmx/universe.cpp b/protocol/dmx/universe.cpp index 30f2726..1d6c2dc 100644 --- a/protocol/dmx/universe.cpp +++ b/protocol/dmx/universe.cpp @@ -124,11 +124,9 @@ void Universe::setData(const std::vector& data) std::copy(data.begin(), data.end(), null_start_data.begin()); null_start_mutex.unlock(); - // update rx times - rx_timeout_(true); - // notify callbacks - doDataCallbacks(); + rx_timeout_(true); // update rx times + doDataCallbacks(); // notify callbacks } @@ -267,6 +265,7 @@ void Universe::rx_timeout_(bool add_now) { auto now = std::chrono::system_clock::now(); auto age = rxAge(); + if (add_now) { setStatus(Status::DMX_ACTIVE); @@ -282,7 +281,7 @@ void Universe::rx_timeout_(bool add_now) }; while (!rx_times_.empty()) - { + { // drop timestamps that are older than the timeout period age = elapsed(now, rx_times_.front()); if (age < rx_timeout_period_) break;