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

This commit is contained in:
adelikat 2015-01-10 15:12:58 +00:00
parent 7ce4fd206e
commit 57023ffcb7
1 changed files with 9 additions and 11 deletions

View File

@ -134,18 +134,11 @@ namespace BizHawk.Client.Common
/// </summary>
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);