allow the mixer to run even when sound blocked. prevents sounds piling up

This commit is contained in:
Bill Currie 2007-03-21 11:39:01 +00:00 committed by Jeff Teunissen
parent b8712f2211
commit 7252ef1e54
1 changed files with 7 additions and 8 deletions

View File

@ -114,6 +114,13 @@ snd_jack_xfer (int endtime)
int count; int count;
count = endtime - snd_paintedtime; count = endtime - snd_paintedtime;
if (snd_blocked) {
for (i = 0; i < count; i++) {
*output[0]++ = 0;
*output[1]++ = 0;
}
return;
}
for (i = 0; i < count; i++) { for (i = 0; i < count; i++) {
*output[0]++ = snd_paintbuffer[i].left / 65536.0; *output[0]++ = snd_paintbuffer[i].left / 65536.0;
*output[1]++ = snd_paintbuffer[i].right / 65536.0; *output[1]++ = snd_paintbuffer[i].right / 65536.0;
@ -124,17 +131,9 @@ static int
snd_jack_process (jack_nframes_t nframes, void *arg) snd_jack_process (jack_nframes_t nframes, void *arg)
{ {
int i; int i;
jack_nframes_t j;
for (i = 0; i < 2; i++) for (i = 0; i < 2; i++)
output[i] = (float *) jack_port_get_buffer (jack_out[i], nframes); output[i] = (float *) jack_port_get_buffer (jack_out[i], nframes);
if (snd_blocked) {
SND_ScanChannels ();
for (j = 0; j < nframes; j++)
for (i = 0; i < 2; i++)
output[i][j] = 0;
return 0;
}
SND_PaintChannels (snd_paintedtime + nframes); SND_PaintChannels (snd_paintedtime + nframes);
return 0; return 0;
} }