aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-12-23 11:56:55 -0800
committerChris Robinson <[email protected]>2014-12-23 11:56:55 -0800
commit6ccf10bbde86c2abe51f19385ad6034d5d282000 (patch)
tree82164112f6192420b599250617716f82bca71249
parente84b3f4707dc24a33826934966b1201811e8057a (diff)
Don't set unused pointers to NULL, don't try to write 0 samples
-rw-r--r--Alc/backends/jack.c15
1 files 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);