From 6ccf10bbde86c2abe51f19385ad6034d5d282000 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 23 Dec 2014 11:56:55 -0800 Subject: Don't set unused pointers to NULL, don't try to write 0 samples --- Alc/backends/jack.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/Alc/backends/jack.c b/Alc/backends/jack.c index 9597f8af..289c0d46 100644 --- a/Alc/backends/jack.c +++ b/Alc/backends/jack.c @@ -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,13 +264,16 @@ static int ALCjackPlayback_process(jack_nframes_t numframes, void *arg) total += todo; todo = minu(numframes-total, data[1].len/frame_size); - for(c = 0;c < numchans;c++) + if(todo > 0) { - for(i = 0;i < todo;i++) - out[c][i] = ((ALfloat*)data[1].buf)[i*numchans + c]; - out[c] += todo; + for(c = 0;c < numchans;c++) + { + for(i = 0;i < todo;i++) + out[c][i] = ((ALfloat*)data[1].buf)[i*numchans + c]; + out[c] += todo; + } + total += todo; } - total += todo; jack_ringbuffer_read_advance(self->Ring, total*frame_size); alcnd_signal(&self->Cond); -- cgit v1.2.3