From 6edd5d7bfa479da0cf140980a326220af35909f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Thu, 21 Oct 2021 17:49:36 +0200 Subject: [PATCH] Avoid an unnecessary assignment. --- OpenRA.Mods.Common/Widgets/VideoPlayerWidget.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Widgets/VideoPlayerWidget.cs b/OpenRA.Mods.Common/Widgets/VideoPlayerWidget.cs index 91ba065734..c1c295aa13 100644 --- a/OpenRA.Mods.Common/Widgets/VideoPlayerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/VideoPlayerWidget.cs @@ -93,11 +93,9 @@ namespace OpenRA.Mods.Common.Widgets if (!stopped && !paused) { - var nextFrame = 0; + var nextFrame = video.CurrentFrame + 1; if (video.HasAudio && !Game.Sound.DummyEngine) nextFrame = (int)float2.Lerp(0, video.Frames, Game.Sound.VideoSeekPosition * invLength); - else - nextFrame = video.CurrentFrame + 1; // Without the 2nd check the sound playback sometimes ends before the final frame is displayed which causes the player to be stuck on the first frame if (nextFrame > video.Frames || nextFrame < video.CurrentFrame)