From 4f13ab7d12a8b336977e89cd8b7196ed33e11f2f Mon Sep 17 00:00:00 2001 From: AJR Date: Tue, 15 May 2018 19:28:00 -0400 Subject: sound.cpp: Perform the sanity check from a0137c10da45fe10e52f9debcf00b266f2234329 in a better place (nw, seems to fix assert error) --- src/emu/sound.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp index 03bc588270c..da20d617f29 100644 --- a/src/emu/sound.cpp +++ b/src/emu/sound.cpp @@ -268,9 +268,6 @@ void sound_stream::update() attotime time = m_device.machine().time(); s32 update_sampindex = s32(time.attoseconds() / m_attoseconds_per_sample); - if (update_sampindex <= m_output_sampindex) - return; - // if we're ahead of the last update, then adjust upwards attotime last_update = m_device.machine().sound().last_update(); if (time.seconds() > last_update.seconds()) @@ -286,6 +283,9 @@ void sound_stream::update() update_sampindex -= m_sample_rate; } + if (update_sampindex <= m_output_sampindex) + return; + // generate samples to get us up to the appropriate time g_profiler.start(PROFILER_SOUND); assert(m_output_sampindex - m_output_base_sampindex >= 0); -- cgit v1.2.3