From 3ccbebb27ac44f781b6be5adc46351c2a354fda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Thu, 12 Jun 2025 13:07:17 +0200 Subject: [PATCH] SasAudio: Don't reset the decoder on SetVoice if all params are the same Should fix #20507 --- Core/HLE/sceSas.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Core/HLE/sceSas.cpp b/Core/HLE/sceSas.cpp index bdd44fc033..b5f74522ef 100644 --- a/Core/HLE/sceSas.cpp +++ b/Core/HLE/sceSas.cpp @@ -343,14 +343,20 @@ static u32 sceSasSetVoice(u32 core, int voiceNum, u32 vagAddr, int size, int loo } u32 prevVagAddr = v.vagAddr; - v.type = VOICETYPE_VAG; + bool reset = false; + if (v.type != VOICETYPE_VAG || v.vagAddr != vagAddr || v.vagSize != size || v.loop != loop) { + v.type = VOICETYPE_VAG; + reset = true; + } v.vagAddr = vagAddr; // Real VAG header is 0x30 bytes behind the vagAddr v.vagSize = size; v.loop = loop != 0; if (v.on) { v.playing = true; } - v.vag.Start(vagAddr, size, loop != 0); + if (reset) { + v.vag.Start(vagAddr, size, loop != 0); + } return hleNoLog(0); }