Avoid an unnecessary assignment.

This commit is contained in:
Matthias Mailänder
2021-10-21 17:49:36 +02:00
committed by abcdefg30
parent a3ccc81892
commit 6edd5d7bfa

View File

@@ -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)