File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -883,7 +883,7 @@ void DMD::SerumThread()
883883 while (true )
884884 {
885885 auto systemNow = std::chrono::system_clock::now ();
886- auto nextWakeTime = systemNow + std::chrono::hours (1 ); // Default: far in the future
886+ auto nextWakeTime = systemNow + std::chrono::hours (24 ); // Default: far in the future
887887
888888 if (nextRotation > 0 )
889889 {
@@ -901,9 +901,18 @@ void DMD::SerumThread()
901901 // Wait until either:
902902 // - m_dmdFrameReady/m_stopFlag is set (via notify_all), OR
903903 // - The timeout (nextRotation/nextSceneFrame) is reached
904- m_dmdCV.wait_until (
905- sl, nextWakeTime, [&]()
906- { return m_dmdFrameReady.load (std::memory_order_relaxed) || m_stopFlag.load (std::memory_order_relaxed); });
904+ m_dmdCV.wait_until (sl, nextWakeTime,
905+ [&]()
906+ {
907+ uint32_t now = std::chrono::duration_cast<std::chrono::milliseconds>(
908+ std::chrono::system_clock::now ().time_since_epoch ())
909+ .count ();
910+
911+ return m_dmdFrameReady.load (std::memory_order_relaxed) ||
912+ m_stopFlag.load (std::memory_order_relaxed) ||
913+ (nextRotation > 0 && nextRotation <= now) ||
914+ (sceneCurrentFrame < sceneFrameCount && nextSceneFrame <= now);
915+ });
907916 sl.unlock ();
908917
909918 if (m_stopFlag.load (std::memory_order_acquire))
You can’t perform that action at this time.
0 commit comments