void __AudioDoState(PointerWrap &p) { p.Do(eventAudioUpdate); CoreTiming::RestoreRegisterEvent(eventAudioUpdate, "AudioUpdate", &hleAudioUpdate); p.Do(eventHostAudioUpdate); CoreTiming::RestoreRegisterEvent(eventHostAudioUpdate, "AudioUpdateHost", &hleHostAudioUpdate); p.Do(mixFrequency); { lock_guard guard(section); outAudioQueue.DoState(p); } int chanCount = ARRAY_SIZE(chans); p.Do(chanCount); if (chanCount != ARRAY_SIZE(chans)) { ERROR_LOG(SCEAUDIO, "Savestate failure: different number of audio channels."); return; } for (int i = 0; i < chanCount; ++i) chans[i].DoState(p); p.DoMarker("sceAudio"); }
void __AudioDoState(PointerWrap &p) { auto s = p.Section("sceAudio", 1); if (!s) return; p.Do(eventAudioUpdate); CoreTiming::RestoreRegisterEvent(eventAudioUpdate, "AudioUpdate", &hleAudioUpdate); p.Do(eventHostAudioUpdate); CoreTiming::RestoreRegisterEvent(eventHostAudioUpdate, "AudioUpdateHost", &hleHostAudioUpdate); p.Do(mixFrequency); if (s >= 2) { resampler.DoState(p); } else { // Only to preserve the previous file format. Might cause a slight audio glitch on upgrades? FixedSizeQueue<s16, 512 * 16> outAudioQueue; outAudioQueue.DoState(p); resampler.Clear(); } int chanCount = ARRAY_SIZE(chans); p.Do(chanCount); if (chanCount != ARRAY_SIZE(chans)) { ERROR_LOG(SCEAUDIO, "Savestate failure: different number of audio channels."); return; } for (int i = 0; i < chanCount; ++i) chans[i].DoState(p); __AudioCPUMHzChange(); }