Don't set unused pointers to NULL, don't try to write 0 samples

This commit is contained in:
Chris Robinson 2014-12-23 11:56:55 -08:00
parent e84b3f4707
commit 6ccf10bbde

View File

@ -253,8 +253,6 @@ static int ALCjackPlayback_process(jack_nframes_t numframes, void *arg)
for(c = 0;c < MAX_OUTPUT_CHANNELS && self->Port[c];c++)
out[c] = jack_port_get_buffer(self->Port[c], numframes);
numchans = c;
for(;c < MAX_OUTPUT_CHANNELS;c++)
out[c] = NULL;
todo = minu(numframes, data[0].len/frame_size);
for(c = 0;c < numchans;c++)
@ -266,6 +264,8 @@ static int ALCjackPlayback_process(jack_nframes_t numframes, void *arg)
total += todo;
todo = minu(numframes-total, data[1].len/frame_size);
if(todo > 0)
{
for(c = 0;c < numchans;c++)
{
for(i = 0;i < todo;i++)
@ -273,6 +273,7 @@ static int ALCjackPlayback_process(jack_nframes_t numframes, void *arg)
out[c] += todo;
}
total += todo;
}
jack_ringbuffer_read_advance(self->Ring, total*frame_size);
alcnd_signal(&self->Cond);