sound.cpp: Perform the sanity check from a0137c10da in a better place (nw, seems to fix assert error)

This commit is contained in:
AJR 2018-05-15 19:28:00 -04:00
parent e9a2814b43
commit 4f13ab7d12

View File

@ -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);