Ensure you don't hand over an already done channel

This commit is contained in:
Gwilym Kuiper 2021-06-25 22:20:18 +01:00
parent 025f4f5a91
commit bd15a87c4d

View file

@ -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);
}
}