summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2020-09-19 12:29:43 -0700
committer Aaron Giles <aaron@aarongiles.com>2020-09-19 12:29:43 -0700
commitf49dca5cff62b74602491e07426d464c8a9e2575 (patch)
tree4040c078cbeddd2b6295e3db079f5771838d19ad
parent8fd87a7257668ebad32b72541cbd4360c15faac8 (diff)
sound: Fix asserts due to sample-rate ping-pong in esq5505 driver
-rw-r--r--src/emu/sound.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp
index 6b54797de36..9ae762b8915 100644
--- a/src/emu/sound.cpp
+++ b/src/emu/sound.cpp
@@ -123,7 +123,14 @@ void stream_buffer::set_sample_rate(u32 rate, bool resample)
for (int index = 0; index < buffered_samples; index++)
{
end = prev_index(end);
- buffer[index] = get(end);
+#if (SOUND_DEBUG)
+ // multiple resamples can occur before clearing out old NaNs so
+ // neuter them for this specific case
+ if (std::isnan(m_buffer[end]))
+ buffer[index] = 0;
+ else
+#endif
+ buffer[index] = get(end);
}
}
}