From 57023ffcb78493adac08f25796815c3ce38bb87c Mon Sep 17 00:00:00 2001 From: adelikat Date: Sat, 10 Jan 2015 15:12:58 +0000 Subject: [PATCH] Movie playback - fix issue 358, duplicate input after a movie ends, note: this commit could be a breaking change for other movie related things (such as alternate movie end types other than the default of "finished") --- BizHawk.Client.Common/movie/MovieSession.cs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/BizHawk.Client.Common/movie/MovieSession.cs b/BizHawk.Client.Common/movie/MovieSession.cs index 9974976846..d17fa1fa38 100644 --- a/BizHawk.Client.Common/movie/MovieSession.cs +++ b/BizHawk.Client.Common/movie/MovieSession.cs @@ -134,18 +134,11 @@ namespace BizHawk.Client.Common /// public void LatchInputFromLog() { - if (Global.Emulator.Frame < Movie.InputLogLength - (Global.Config.MovieEndAction == MovieEndAction.Pause ? 1 : 0)) // Pause logic is a hack for now + var input = Movie.GetInputState(Global.Emulator.Frame); + MovieControllerAdapter.LatchFromSource(input); + if (MultiTrack.IsActive) { - var input = Movie.GetInputState(Global.Emulator.Frame); - MovieControllerAdapter.LatchFromSource(input); - if (MultiTrack.IsActive) - { - Global.MultitrackRewiringAdapter.Source = MovieControllerAdapter; - } - } - else - { - HandlePlaybackEnd(); + Global.MultitrackRewiringAdapter.Source = MovieControllerAdapter; } } @@ -235,6 +228,11 @@ namespace BizHawk.Client.Common public void HandleMovieOnFrameLoop() { + if (Movie.IsActive && !Movie.IsFinished && Global.Emulator.Frame >= Movie.InputLogLength) + { + HandlePlaybackEnd(); + } + if (!Movie.IsActive) { LatchInputFromPlayer(Global.MovieInputSourceAdapter);