From 01f7bd440e35ba39672096afc4e5c0e3e51f154b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Tue, 8 May 2007 10:49:54 +0000 Subject: [PATCH] slightly cleaner --- libs/audio/renderer/snd_channels.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/libs/audio/renderer/snd_channels.c b/libs/audio/renderer/snd_channels.c index dc24a0fe5..7bc356462 100644 --- a/libs/audio/renderer/snd_channels.c +++ b/libs/audio/renderer/snd_channels.c @@ -339,21 +339,13 @@ s_pick_channel (int entnum, int entchannel, int looped) } _ch = &(*_ch)->next; } - // check for finished looped sounds - // normally, this wouldn't happen, but when using the non-threaded mixer - // it seems to - for (_ch = &looped_dynamic_channels; *_ch; ) { - if (!(*_ch)->sfx || (*_ch)->done) { - SND_ChannelStop (unlink_channel (_ch)); - continue; - } - _ch = &(*_ch)->next; - } // non-looped sounds are used to stop looped sounds on an ent channel + // also clean out any caught by SND_ScanChannels for (_ch = &looped_dynamic_channels; *_ch; ) { - if ((*_ch)->entnum == entnum - && ((*_ch)->entchannel == entchannel || entchannel == -1)) { + if (!(*_ch)->sfx || (*_ch)->done + || ((*_ch)->entnum == entnum + && ((*_ch)->entchannel == entchannel || entchannel == -1))) { SND_ChannelStop (unlink_channel (_ch)); continue; }