HD Packs: Fixed crash when loading save states
This commit is contained in:
parent
3cc5398165
commit
f2112dbadc
3 changed files with 12 additions and 2 deletions
|
@ -178,7 +178,9 @@ bool SaveStateManager::LoadState(istream &stream, bool hashCheckRequired)
|
|||
#ifndef LIBRETRO
|
||||
vector<uint8_t> frameData;
|
||||
if(GetScreenshotData(frameData, stream)) {
|
||||
_console->GetVideoDecoder()->UpdateFrameSync(frameData.data());
|
||||
if(_console->IsPaused()) {
|
||||
_console->GetVideoDecoder()->UpdateFrameSync(frameData.data());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -163,6 +163,14 @@ void VideoDecoder::UpdateFrameSync(void *ppuOutputBuffer, HdScreenInfo *hdScreen
|
|||
return;
|
||||
}
|
||||
|
||||
if(_frameChanged) {
|
||||
//Last frame isn't done decoding yet - sometimes Signal() introduces a 25-30ms delay
|
||||
while(_frameChanged) {
|
||||
//Spin until decode is done
|
||||
}
|
||||
//At this point, we are sure that the decode thread is no longer busy
|
||||
}
|
||||
|
||||
_frameNumber = _console->GetFrameCount();
|
||||
_hdScreenInfo = hdScreenInfo;
|
||||
_ppuOutputBuffer = (uint16_t*)ppuOutputBuffer;
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
#include <cctype>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <array>
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
#include <list>
|
||||
#include <atomic>
|
||||
|
|
Loading…
Add table
Reference in a new issue