From f49dca5cff62b74602491e07426d464c8a9e2575 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Sat, 19 Sep 2020 12:29:43 -0700 Subject: sound: Fix asserts due to sample-rate ping-pong in esq5505 driver --- src/emu/sound.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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); } } } -- cgit v1.2.3