Savestates: Fixed audio issues when loading savestate saved in one region while the UI is configured to use another region (e.g ntsc vs pal)
This commit is contained in:
parent
509d85b2a3
commit
44ca91adb1
1 changed files with 10 additions and 3 deletions
|
@ -41,9 +41,14 @@ SoundMixer::~SoundMixer()
|
|||
|
||||
void SoundMixer::StreamState(bool saving)
|
||||
{
|
||||
Stream(_clockRate, _sampleRate);
|
||||
Stream(_clockRate, _sampleRate, _model);
|
||||
|
||||
if(!saving) {
|
||||
if(_model == NesModel::Auto) {
|
||||
//Older savestates - assume NTSC
|
||||
_model = NesModel::NTSC;
|
||||
}
|
||||
|
||||
Reset();
|
||||
UpdateRates(true);
|
||||
}
|
||||
|
@ -174,8 +179,10 @@ void SoundMixer::PlayAudioBuffer(uint32_t time)
|
|||
|
||||
void SoundMixer::SetNesModel(NesModel model)
|
||||
{
|
||||
_model = model;
|
||||
UpdateRates(true);
|
||||
if(_model != model) {
|
||||
_model = model;
|
||||
UpdateRates(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SoundMixer::UpdateRates(bool forceUpdate)
|
||||
|
|
Loading…
Add table
Reference in a new issue