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,8 +178,10 @@ bool SaveStateManager::LoadState(istream &stream, bool hashCheckRequired)
|
||||||
#ifndef LIBRETRO
|
#ifndef LIBRETRO
|
||||||
vector<uint8_t> frameData;
|
vector<uint8_t> frameData;
|
||||||
if(GetScreenshotData(frameData, stream)) {
|
if(GetScreenshotData(frameData, stream)) {
|
||||||
|
if(_console->IsPaused()) {
|
||||||
_console->GetVideoDecoder()->UpdateFrameSync(frameData.data());
|
_console->GetVideoDecoder()->UpdateFrameSync(frameData.data());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -163,6 +163,14 @@ void VideoDecoder::UpdateFrameSync(void *ppuOutputBuffer, HdScreenInfo *hdScreen
|
||||||
return;
|
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();
|
_frameNumber = _console->GetFrameCount();
|
||||||
_hdScreenInfo = hdScreenInfo;
|
_hdScreenInfo = hdScreenInfo;
|
||||||
_ppuOutputBuffer = (uint16_t*)ppuOutputBuffer;
|
_ppuOutputBuffer = (uint16_t*)ppuOutputBuffer;
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
#include <cctype>
|
#include <cctype>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <array>
|
#include <algorithm>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
|
|
Loading…
Add table
Reference in a new issue