Skip to content

Commit

Permalink
sound.cpp: Perform the sanity check from a0137c1 in a better place (n…
Browse files Browse the repository at this point in the history
…w, seems to fix assert error)
  • Loading branch information
ajrhacker committed May 15, 2018
1 parent e9a2814 commit 4f13ab7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/emu/sound.cpp
Expand Up @@ -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())
Expand All @@ -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);
Expand Down

0 comments on commit 4f13ab7

Please sign in to comment.