From 855b9dccc08fad27a61113f401480b1d88760b92 Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Sat, 4 Jun 2022 18:29:37 +0900 Subject: [PATCH] [sound] Don't free channels when allocating SND_AllocChannel is a little too aggressive in freeing channels that have finished as the channel may be externally owned (eg, by cd_file). Get bgm looping working again. --- libs/audio/renderer/snd_channels.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/libs/audio/renderer/snd_channels.c b/libs/audio/renderer/snd_channels.c index cf04aaeec..b41f30ae2 100644 --- a/libs/audio/renderer/snd_channels.c +++ b/libs/audio/renderer/snd_channels.c @@ -164,14 +164,6 @@ SND_AllocChannel (snd_t *snd) { channel_t *chan; - // chech for any channels that have become available as the mixer thread - // has finished with them - for (int i = 0; i < MAX_CHANNELS; i++) { - channel_t *ch = &snd_channels[i]; - if (ch->done) { - snd_free_channel (ch); - } - } //Sys_MaskPrintf (SYS_snd, "SND_AllocChannel: free channels: %d\n", // snd_num_free_channels); if (!snd_num_free_channels) {