From ad11a9072050784e0abf2bc1191ed3e0ae2d1d17 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 23 Dec 2014 22:02:56 -0800 Subject: Don't update the channel format if all JACK ports were allocated --- Alc/backends/jack.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'Alc') diff --git a/Alc/backends/jack.c b/Alc/backends/jack.c index d5ce956c..639037bc 100644 --- a/Alc/backends/jack.c +++ b/Alc/backends/jack.c @@ -395,21 +395,23 @@ static ALCboolean ALCjackPlayback_reset(ALCjackPlayback *self) if(self->Port[i] == NULL) { ERR("Not enough JACK ports available for %s output\n", DevFmtChannelsString(device->FmtChans)); - if(i == 0) - return ALC_FALSE; + if(i == 0) return ALC_FALSE; break; } } - if(i == 1) - device->FmtChans = DevFmtMono; - else if(i < numchans) + if(i < numchans) { - for(--i;i >= 2;i--) + if(i == 1) + device->FmtChans = DevFmtMono; + else { - jack_port_unregister(self->Client, self->Port[i]); - self->Port[i] = NULL; + for(--i;i >= 2;i--) + { + jack_port_unregister(self->Client, self->Port[i]); + self->Port[i] = NULL; + } + device->FmtChans = DevFmtStereo; } - device->FmtChans = DevFmtStereo; } ll_ringbuffer_free(self->Ring); -- cgit v1.2.3