summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2018-05-15 18:02:08 +0200
committer Olivier Galibert <galibert@pobox.com>2018-05-15 19:28:34 +0200
commita0137c10da45fe10e52f9debcf00b266f2234329 (patch)
treea37dd8d27d827f3ee87617ccc6f0544d0b24423f
parent6762946a67a2c5d2a8755f3e9150bf68e1361329 (diff)
sound: If stream->update() is done going back in time (originating from
different devices at a different execution point), don't try to generate a negative number of samples [O. Galibert] Not sure why that never happened before. Oh well.
-rw-r--r--src/emu/sound.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp
index be16a3476e3..03bc588270c 100644
--- a/src/emu/sound.cpp
+++ b/src/emu/sound.cpp
@@ -268,6 +268,9 @@ 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())