From 98b7d3bcbc8c757ff8223c4969aa91a38dcb83f3 Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Thu, 24 Sep 2020 21:00:49 -0700 Subject: sound: Fix assertion when loading save state from command line. --- src/emu/sound.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index babd1b57b0d..1bb5ce0c40b 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -88,9 +88,9 @@ void stream_buffer::set_sample_rate(u32 rate, bool resample) if (rate == m_sample_rate) return; - // force resampling off if coming to or from an invalid rate + // force resampling off if coming to or from an invalid rate, or if we're at time 0 (startup) sound_assert(rate >= SAMPLE_RATE_MINIMUM - 1); - if (rate < SAMPLE_RATE_MINIMUM || m_sample_rate < SAMPLE_RATE_MINIMUM) + if (rate < SAMPLE_RATE_MINIMUM || m_sample_rate < SAMPLE_RATE_MINIMUM || (m_end_second == 0 && m_end_sample == 0)) resample = false; // note the time and period of the current buffer (end_time is AFTER the final sample) -- cgit v1.2.3