Clear history samples when resetting channel

This commit is contained in:
PJB3005
2026-03-17 00:03:15 +01:00
parent b6fc8019ce
commit db47a6b9bd
+4 -1
View File
@@ -60,7 +60,7 @@ static void RenderChannel(
ChannelAuxData& channelAux,
DspSubframe& subframe);
static void ResetChannel(JASDsp::TChannel& channel, const ChannelAuxData& aux) {
static void ResetChannel(JASDsp::TChannel& channel, ChannelAuxData& aux) {
channel.mSamplesLeft = channel.mEndSample - channel.mSamplePosition;
const SDL_AudioSpec spec = {
@@ -69,6 +69,9 @@ static void ResetChannel(JASDsp::TChannel& channel, const ChannelAuxData& aux) {
static_cast<int>(static_cast<u64>(SampleRate) * channel.mPitch / 4096)
};
aux.hist0 = 0;
aux.hist1 = 0;
SDL_ClearAudioStream(aux.resampleStream);
SDL_SetAudioStreamFormat(aux.resampleStream, &spec, nullptr);