Fixed an issue where the static video image would not be displayed after metadata changes.

This commit is contained in:
Leon Styhre 2021-04-09 22:54:00 +02:00
parent 2aa4ef385d
commit 837f781e04

View file

@ -222,11 +222,15 @@ void VideoComponent::render(const Transform4x4f& parentTrans)
void VideoComponent::renderSnapshot(const Transform4x4f& parentTrans) void VideoComponent::renderSnapshot(const Transform4x4f& parentTrans)
{ {
// This is the case where the video is not currently being displayed. Work out // This function is called when the video is not currently being played. We need to
// if we need to display a static image. // work out if we should display a static image. If the menu is open, then always render
if ((mConfig.showSnapshotNoVideo && mVideoPath.empty()) || // the static image as the metadata may have been changed. In that case the gamelist
// was reloaded and there would just be a blank space unless we render the image here.
// The side effect of this is that a static image is displayed even for themes that are
// set to start playing the video immediately. Although this may seem a bit inconsistent it
// simply looks better than leaving an empty space where the video would have been located.
if (mWindow->getGuiStackSize() > 1 || (mConfig.showSnapshotNoVideo && mVideoPath.empty()) ||
(mStartDelayed && mConfig.showSnapshotDelay)) { (mStartDelayed && mConfig.showSnapshotDelay)) {
// Display the static image instead.
mStaticImage.setOpacity(mOpacity); mStaticImage.setOpacity(mOpacity);
mStaticImage.render(parentTrans); mStaticImage.render(parentTrans);
} }