Skip to content

Commit 66599ed

Browse files
authored
emu/disound.cpp: Improved calculation of sound_requested_outputs_mask. (#15260)
Ensures m_sound_requested_outputs_mask is updated even if a device's add_route(output_index, ...) calls don't happen in the order of output_index.
1 parent a42d801 commit 66599ed

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/emu/disound.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,10 @@ void device_sound_interface::sound_before_devices_init()
313313
for(sound_route &route : routes()) {
314314
device_t *dev = route.m_base.get().subdevice(route.m_target);
315315
dev->interface(route.m_interface);
316-
if(route.m_output != ALL_OUTPUTS && m_sound_requested_outputs <= route.m_output) {
316+
if(route.m_output != ALL_OUTPUTS) {
317317
m_sound_requested_outputs_mask |= u64(1) << route.m_output;
318-
m_sound_requested_outputs = route.m_output + 1;
318+
if(m_sound_requested_outputs <= route.m_output)
319+
m_sound_requested_outputs = route.m_output + 1;
319320
}
320321
route.m_interface->sound_request_input(route.m_input);
321322
}

0 commit comments

Comments
 (0)