mirror of
https://github.com/RetroDECK/MAME.git
synced 2024-11-23 21:25:39 +00:00
28 lines
779 B
Diff
28 lines
779 B
Diff
|
diff --git a/src/emu/sound.cpp b/src/emu/sound.cpp
|
||
|
index a0293063..c4989abb 100644
|
||
|
--- a/src/emu/sound.cpp
|
||
|
+++ b/src/emu/sound.cpp
|
||
|
@@ -761,6 +761,9 @@ read_stream_view sound_stream::update_view(attotime start, attotime end, u32 out
|
||
|
}
|
||
|
g_profiler.stop();
|
||
|
|
||
|
+ if (!m_output_view[outputnum].valid())
|
||
|
+ m_output_view[outputnum] = empty_view(start, end);
|
||
|
+
|
||
|
// return the requested view
|
||
|
return read_stream_view(m_output_view[outputnum], start);
|
||
|
}
|
||
|
diff --git a/src/emu/sound.h b/src/emu/sound.h
|
||
|
index 15f6a574..bfa45c45 100644
|
||
|
--- a/src/emu/sound.h
|
||
|
+++ b/src/emu/sound.h
|
||
|
@@ -284,6 +284,9 @@ public:
|
||
|
return *this;
|
||
|
}
|
||
|
|
||
|
+ // check basic constraints
|
||
|
+ bool valid() const { return m_buffer != nullptr; }
|
||
|
+
|
||
|
// return the local gain
|
||
|
sample_t gain() const { return m_gain; }
|
||
|
|