From c21113d039e624a29bd022ddd8c323eca75a0883 Mon Sep 17 00:00:00 2001 From: LordGrey Date: Wed, 25 Jan 2023 22:00:57 +0100 Subject: [PATCH] Workaround - Suppress empty LED updates --- libsrc/hyperion/LinearColorSmoothing.cpp | 39 +++++++++++++----------- 1 file changed, 21 insertions(+), 18 deletions(-) diff --git a/libsrc/hyperion/LinearColorSmoothing.cpp b/libsrc/hyperion/LinearColorSmoothing.cpp index 4cf6d4b9..3a7d0d98 100644 --- a/libsrc/hyperion/LinearColorSmoothing.cpp +++ b/libsrc/hyperion/LinearColorSmoothing.cpp @@ -510,29 +510,32 @@ void LinearColorSmoothing::clearRememberedFrames() void LinearColorSmoothing::queueColors(const std::vector &ledColors) { - if (_outputDelay == 0) + if (ledColors.size() > 0) { - // No output delay => immediate write - if (!_pause) + if (_outputDelay == 0) { - emit _hyperion->ledDeviceData(ledColors); - } - } - else - { - // Push new colors in the delay-buffer - _outputQueue.push_back(ledColors); - - // If the delay-buffer is filled pop the front and write to device - if (!_outputQueue.empty()) - { - if (_outputQueue.size() > _outputDelay) + // No output delay => immediate write + if (!_pause) { - if (!_pause) + emit _hyperion->ledDeviceData(ledColors); + } + } + else + { + // Push new colors in the delay-buffer + _outputQueue.push_back(ledColors); + + // If the delay-buffer is filled pop the front and write to device + if (!_outputQueue.empty()) + { + if (_outputQueue.size() > _outputDelay) { - emit _hyperion->ledDeviceData(_outputQueue.front()); + if (!_pause) + { + emit _hyperion->ledDeviceData(_outputQueue.front()); + } + _outputQueue.pop_front(); } - _outputQueue.pop_front(); } } }