clamp the default renderer to 44100 too, and spew messages when running out of channels.

This commit is contained in:
Bill Currie 2007-03-25 01:02:03 +00:00 committed by Jeff Teunissen
parent 3609a2215e
commit 6678e67f05
2 changed files with 11 additions and 3 deletions

View file

@ -81,8 +81,6 @@ SND_AllocChannel (void)
channel_t **free = &free_channels;
channel_t *chan;
if (!*free) // definitely nothing free
return 0;
while (*free) {
if (!(*free)->sfx) // free channel
break;
@ -92,8 +90,14 @@ SND_AllocChannel (void)
Sys_Error ("SND_AllocChannel: bogus channel free list");
free = &(*free)->next;
}
if (!*free)
if (!*free) {
int num_free = 0;
for (free = &free_channels; *free; free = &(*free)->next) {
num_free++;
}
Sys_Printf ("SND_AllocChannel: out of channels. %d\n", num_free);
return 0;
}
chan = *free;
*free = chan->next;
if (chan->sfx) {

View file

@ -351,6 +351,10 @@ s_startup (void)
return;
}
snd_shm->xfer = s_xfer_paint_buffer;
if (snd_shm->speed > 44100) {
Sys_Printf ("FIXME clamping Sps to 44100 until resampling is fixed\n");
snd_shm->speed = 44100;
}
sound_started = 1;
}