From 3789a0ca12271b741beae53dcc23c84e010e1794 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sat, 17 Sep 2022 10:24:46 +0200 Subject: [PATCH] Fixed a heisenbug where videos would sometimes not get rendered on application startup. --- es-core/src/components/VideoComponent.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/es-core/src/components/VideoComponent.cpp b/es-core/src/components/VideoComponent.cpp index 6965e03b0..d0627e166 100644 --- a/es-core/src/components/VideoComponent.cpp +++ b/es-core/src/components/VideoComponent.cpp @@ -272,6 +272,11 @@ std::vector VideoComponent::getHelpPrompts() void VideoComponent::update(int deltaTime) { + // A deltaTime value of 0 would lead to mFadeIn being an invalid number which would prevent + // the video from being rendered. This can happen on application startup in some instances. + if (deltaTime == 0) + deltaTime = 1; + if (!mHasVideo) { // We need this update so the static image gets updated (e.g. used for fade animations). GuiComponent::update(deltaTime);