From bd15a87c4de3cc829e95328f89953b1aadeed99e Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Fri, 25 Jun 2021 22:20:18 +0100 Subject: [PATCH] Ensure you don't hand over an already done channel --- agb/src/sound/mixer/sw_mixer.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agb/src/sound/mixer/sw_mixer.rs b/agb/src/sound/mixer/sw_mixer.rs index d423c647..accc4168 100644 --- a/agb/src/sound/mixer/sw_mixer.rs +++ b/agb/src/sound/mixer/sw_mixer.rs @@ -65,7 +65,7 @@ impl Mixer { pub fn get_channel(&mut self, id: &ChannelId) -> Option<&'_ mut SoundChannel> { if let Some(channel) = &mut self.channels[id.0] { - if self.indices[id.0] == id.1 { + if self.indices[id.0] == id.1 && !channel.is_done { return Some(channel); } }