[IDEA] Fix recording when using `speedup/turbo`.

We do not allow to skip frames while recording. The resulting length
will be extended compared to using turbo/speedup modes, because the
recording will be normal time (as in running without turbo/speedup).
This commit is contained in:
Edênis Freindorfer Azevedo 2019-08-06 21:57:04 -03:00 committed by Rafael Kitover
parent 738494a232
commit f5b19475c9
2 changed files with 9 additions and 2 deletions

View File

@ -5150,8 +5150,8 @@ void gbEmulate(int ticksToStop)
gbDrawLine();
} else if ((register_LY == 144) && (!systemFrameSkip)) {
int framesToSkip = systemFrameSkip;
if (speedup)
framesToSkip = 9; // try 6 FPS during speedup
//if (speedup)
// framesToSkip = 9; // try 6 FPS during speedup
if ((gbFrameSkipCount >= framesToSkip) || (gbWhiteScreen == 1)) {
gbWhiteScreen = 2;

View File

@ -2336,10 +2336,15 @@ static const wxString media_err(recording::MediaRet ret)
}
}
int save_speedup_frame_skip;
void GameArea::StartVidRecording(const wxString& fname)
{
recording::MediaRet ret;
// do not skip frames when recording
save_speedup_frame_skip = speedup_frame_skip;
speedup_frame_skip = 0;
vid_rec.SetSampleRate(soundGetSampleRate());
if ((ret = vid_rec.Record(fname.mb_str(), basic_width, basic_height,
systemColorDepth))
@ -2357,6 +2362,8 @@ void GameArea::StartVidRecording(const wxString& fname)
void GameArea::StopVidRecording()
{
vid_rec.Stop();
// allow to skip frames again
speedup_frame_skip = save_speedup_frame_skip;
MainFrame* mf = wxGetApp().frame;
mf->cmd_enable &= ~CMDEN_VREC;
mf->cmd_enable |= CMDEN_NVREC;